What is the maximum value of the following function? $$4\sin^2(x) + 3\cos^2(x) + \sin\left(\dfrac{x}{2}\right) + \cos\left(\frac{x}{2}\right)$$
I have tried to solve the problem in this way, but got an answer of $4$. The answer provided is $4+\sqrt{2}$.
I cannot find where I have made a mistake. Please find where I have made mistake in the image provided....
Sorry I have written x=pi/2 by mistake, but I have done it using x=0
$4\text{sin}^2x + 3\text{cos}^2x+ \text{sin}(\frac{x}{2}) + \text{cos}(\frac{x}{2})$
= $4\text{sin}^2x + 3-3\text{sin}^2x+ \text{sin}(\frac{x}{2}) + \text{cos}(\frac{x}{2})$
= $\text{sin}^2x + 3+ \text{sin}(\frac{x}{2}) + \text{cos}(\frac{x}{2})$
=$\text{sin}^2x + 3+\sqrt2 \text{sin}(\frac{\pi}{4}+\frac{x}{2})$
Now, when $x=\frac{\pi}{2}$, $\text{sin}(\frac{\pi}{4}+\frac{x}{2})=1$
So, when $x=\frac{\pi}{2}$, $\text{sin}^2x + 3+\sqrt2 \text{sin}(\frac{\pi}{4}+\frac{x}{2})=4+\sqrt2$