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.

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?
