What will be the maximum value of expression: 7sin²x + 5cos²x +√2[sin(x/2) + cos(x/2)]? This is what I've managed to do:
$=5 + 2\sin²x +√2[\sin(x/2) + \sin(π/2 - x/2)]$
$=5 + 2\sin²x + √2[2.\sin((x/2 + π/2 -x/2)/2)·\cos((x/2 - π/2 + x/2)/2)]$
$=5 + 2\sin²x + √2[2\sin(π/4)\cos(x/2 - π/4)]$
$=5 + 2\sin²x + 2\cos(x/2 - π/4)$
From here I've tried to reduce everything to $\sin(x/2)$ and $\cos(x/2)$ but unfortunately I can't do anything further.
Please help and provide a solution.
 A: $f(x) = 5 + 2\sin^2(x) + \sqrt{2}(\sin(x/2) + \cos(x/2))$
Let $u = \sin(x/2) + \cos(x/2)$, so $u^2 = 1 + 2 \sin(x/2) \cos(x/2)$.
Also, $\sin(x) = 2 \sin(x/2) \cos(x/2) = u^2-1$.
Substituting back: $f(u) = 5 + 2(u^2-1)^2 + \sqrt{2}u$.
Now we are in the polynomial world. Follow the usual steps to find extrema? (keep in mind that by defintion $u \in [-\sqrt{2}, \sqrt{2}]$.)
A: HINT
I would start with noticing that
\begin{align*}
\sqrt{2}\left[\sin\left(\frac{x}{2}\right) + \cos\left(\frac{x} 
{2}\right)\right] & = 2\times \left[\frac{1}{\sqrt{2}}\times\sin\left(\frac{x}{2}\right) + \frac{1}{\sqrt{2}}\times\cos\left(\frac{x}{2}\right)\right]\\\\
& = 2\sin\left(\frac{x}{2} + \frac{\pi}{4}\right)
\end{align*}
Moreover, we do also have that
\begin{align*}
7\sin^{2}(x) + 5\cos^{2}(x) & = 7\times [\sin^{2}(x) + \cos^{2}(x)] - 2\cos^{2}(x)\\\\
& = 7 - 2\cos^{2}(x)\\\\
& = 6 - \cos(2x)
\end{align*}
Hence the proposed function can be described as
\begin{align*}
f(x) & := 7\sin^{2}(x) + 5\cos^{2}(x) + \sqrt{2}\times\left[\sin\left(\frac{x}{2}\right) + \cos\left(\frac{x}{2}\right)\right]\\\\
& = 6 - 2\cos(2x) + 2\sin\left(\frac{x}{2} + \frac{\pi}{4}\right)
\end{align*}
whose first derivative is given by:
\begin{align*}
f'(x) = -4\sin(2x) + \cos\left(\frac{x}{2} + \frac{\pi}{4}\right)
\end{align*}
Can you take it from here?
