The maximum value of the function f (x) = cos ^ 2x + 4sinx + 3 is

The maximum value of the function f (x) = cos ^ 2x + 4sinx + 3 is

y=cos²x+4sinx+4
=1-sin²x+4sinx+4
=-(sin²x-4sinx+4)+1+4
=-(sinx-2)²+5
Since: - 1 ≤ SiNx ≤ 1, it can be concluded that:
When SiNx = 1, the maximum value is: 6
When SiNx = - 1, the minimum value is: 4