Find the absolute maximum and minimum on the interval `[-pi,pi]` for the function `G(x)=cos2x+2sinx`

The function is continuous on the closed interval and differentiable on the open interval so there is an absolute maximum and an absolute minimum on the interval.

To find the extrema we find the critical points (where G'(x)=0) and then evaluate the function at the critical point(s) and the endpoints of the interval.

`G'(x)=-2sin2x+2cosx`

`=-4sinxcosx+2cosx`

`=2cosx(-2sinx+1)`

Setting `G'(x)=0` we get:

`2cosx(-2sinx+1)=0`

`2cosx=0==>x=-pi/2,x=pi/2`

`-2sinx+1=0==>sinx=1/2==>x=pi/6,x=(5pi)/6`

To find the absolute max and min we evaluate the function at the critical points `x=-pi/2,pi/6,pi/2,(5pi)/6` and the endpoints `x=-pi,pi`

`G(-pi)=1`

`G(-pi/2)=-3`

`G(pi/6)=1.5`

`G(pi/2)=1`

`G((5pi)/6)=1.5`

`G(pi)=1`

Then on the interval `[-pi,pi]` the function has an absolute maximum value of 1.5 which occurs at `x=pi/6` and `x=(5pi)/6` ; the function has an absolute minimum on the interval of -3 which occurs at `x=-pi/2`

The graph: