Can someone help me write an equation for a graph as shown in the image, midline 1 period 4 amplitude 2

Answer:
[tex]\displaystyle f(x)=2cos\left( \frac{\pi}{2}x\right)+1[/tex]
Midline:1
Amplitude: 2
Period: 4
Step-by-step explanation:
Equation of a Cosine
The general equati of of the cosine is
[tex]f(x)=A.cos(wx+\phi)+M[/tex]
With the following parameters:
A=Amplitude or half the length from the maximum to the minimum values
w=angular frequency (rad/sec)
[tex]\phi[/tex]=phase shift (rad or degrees)
M=Midline of vertical shift.
The cosine and the sine are both sinusoid functions but we have chosen the cosine as the selected function because its value is maximum when x=0, just like the graph shown in the question.
It can be seen that the maximum value is 3 and the minimum value is -1. That gives us the amplitude:
[tex]\displaystyle A=\frac{3+1}{2}=2[/tex]
The midline can be found as the displacement from the center of the wave. Since the maximum value is 3 and the amplitude is 2, the midline is
[tex]M=3-2=1[/tex]
The general equation is now
[tex]f(x)=2cos(wx+\phi)+1[/tex]
To compute the phase shift and the angular frequency, we take two points from the graph: (0,3) (4,3). Let's plug in both values:
[tex]f(0)=2cos(w(0)+\phi)+1=3[/tex]
[tex]2cos\phi=2[/tex]
Solving
[tex]cos\phi=1[/tex]
[tex]\phi=0[/tex]
The equation is now
[tex]f(x)=2cos(wx)+1[/tex]
Now for the next point
[tex]f(4)=2cos(w\cdot 4)+1=3[/tex]
2cos(4w)=2
cos(4w)=1
The solution for the equation cannot be an angle of 0, we go forward to the next angle where the cosine is 1
[tex]4w=2\pi[/tex]
Or, equivalently
[tex]\displaystyle w=\frac{\pi}{2}[/tex]
The period is given by
[tex]\displaystyle T=\frac{2\pi}{w}[/tex]
[tex]\displaystyle T=\frac{2\pi}{\frac{\pi}{2}}=4[/tex]
The equation of the function is
[tex]\displaystyle f(x)=2cos\left( \frac{\pi}{2}x\right)+1[/tex]