There is more than one way to do this problem. You can use the chain rule, or I have chosen to use the product rule.

The first derivative can be found using the product rule by noting that cos²(x)=cos(x)cos(x).

`d/dx` cos(x)cos(x)=( `d/dx` cos(x))cos(x) + cos(x)(`d/dx` cos(x)) = 2cos(x)(`d/dx` cos(x))

`d/dx` cos(x) = -sin(x)

`d/dx` cos²(x)=-2cos(x)sin(x) which can also be denoted by y'=-2cos(x)sin(x).

To find y'', we need to take the derivative of y'.

`dy/dx` -2cos(x)sin(x)=-2cos(x)(`dy/dx` sin(x)) + (`dy/dx` (-2cos(x)))sin(x)

`dy/dx` sin(x) = cos(x), so -2cos(x)(`dy/dx` (sin(x)) = -2cos(x)cos(x) = -2cos²(x)

`dy/dx` (-2cos(x)) = -2(`dy/dx` cos(x)) = -2(-sin(x)) = 2sin(x), so (`dy/dx` (-2cos(x)))sin(x) = 2sin(x)sin(x) = 2sin²(x)

When we add the two together we get y''= -2cos²(x) + 2sin²(x) = 2(sin²(x)-cos²(x))

``

` `