Write a cosine function that has an amplitude of 5, a midline of y=2 and a period of 3π.

The general form of a cosine function is given by:

y = A*cos(B(x - C)) + D

where A represents the amplitude, B represents the period and any horizontal shift, C represents any horizontal shift, and D represents the vertical shift.

In this case, we have:
Amplitude (A) = 5
Midline = y = 2 (which corresponds to a vertical shift of +2)
Period (B) = 3π

Plugging these values into the general form, we have:

y = 5*cos(B(x - C)) + 2

Now, since the period for cosine function is determined by 2π/B, we know that 3π = 2π/B. Solving for B:

3π = 2π/B
B = 2/3

Plugging this values into the equation, we have:

y = 5*cos((2/3)(x - C)) + 2

So, the cosine function with an amplitude of 5, a midline of y = 2, and a period of 3π is given by:

y = 5*cos((2/3)(x - C)) + 2