Hm, I've followed your steps but I'm struggling to grasp how you're able to replace cos(x) with u and find the maximum of f(x) = (cos x - 1/2)^2 - 1/16 based on f(u) = (u-1/2)^2 - 1/16 for -1<= u <=1
We know that no matter what values of

we put into
)
, the smallest number we can get out is

and the largest number out is

. That is,
 \leq 1)
. So we can replace the
)
in our function with another variable that can take these same values, so that you're effectively getting the same values of

back out. If you plot
)
for those values you'll get the same values out if you were to plot
)
for all values of

. (see how the

values are the same
https://www.desmos.com/calculator/zmjvisslih). So you can then maximise your new function to maximise the old one. The only change will be that you'll be putting a different value into that function to get the maximum, so you'd find it at a different value of

than

, but if you were asked to find this value of

, you know how the two are related (
)
), and so can work it back.
Hope that helps
