A general cosine function (we could also use a sine function) is written as:
y = A*cos(k*x + p) + M
We will find that the function of the graph is:
f(x) = 2*cos(2*x + 2.09) - 2
Let's return to the general function:
y = A*cos(k*x + p) + M
A is the amplitude, it defines the distance between the value of a maximum and the value of the minimum, such that A is exactly half of that difference.
Here we can see that the maximum is 0, and the minimum is -4
The differene is: 0 - (-4) = 4
Then:
A = 4/2 = 2
f(x) = 2*cos(k*x + p) + M.
M is the midline, this is, the horizontal line that cuts the graph in two halves. Here we can see that the midline is x = -2, then:
M = -2
f(x) = 2*cos(k*x + p) - 2
p is the phase shift.
In the graph, we can see that f(0) = -3, so we have:
f(0) = 2*cos(0 + p) - 2 = -3
cos(p) = -1/2
p = Acos(-1/2) = 2.09
Then we have:
f(x) = 2*cos(k*x + 2.09) - 2
Finally, k is related to the frequency of the function.
We can see that the function does a complete cycle at x = pi
This means that:
f(x) = f(x + pi)
Knowing that the period of a cosine function is 2*pi, then:
k*(x + pi) = k*x + 2*pi
k = 2
Then the equation of the graph is:
f(x) = 2*cos(2*x + 2.09) - 2
If you want to learn more, you can read: