Step-by-step explanation
we can describe the cosine function as

where
amplitude is A
Frequency is B
period is 2π/B
phase shift is C (positive is to the left)
vertical shift is D
Step 1
identify

hence

Step 2
midline
The equation of the midline of periodic function is the average of the maximum and minimum values of the function.
a) we have a maximum when

b) we have a minimum when

so, the midline is the average of 8 and -2

I hope this helps you