I came across a question in the book Calculus for the Practical Man. The question stated to find the maximum or minimum value of the following function:
$$f(x) = \frac{1}{4}\cos^2x - \sin 2x$$
I tried to find first the critical value by differentiating this function to get:
$$f'(x) = \frac{-\sin2x}{4}-2\cos2x$$
However, I am unable to solve it further to get the value of $x$ for the maximum or minimum. Can someone please help me out? Thanks for helping.
Rewrite, $$f(x)=\frac18\left(1+\cos(2x)-8\sin(2x)\right)$$ Note that $a\sin x +b\cos x$ has maximum $\sqrt{a^2+b^2}$ and minimum $-\sqrt{a^2+b^2}$. Thus, $$\max f = \frac{1+\sqrt{65}}8$$ $$\min f = \frac{1-\sqrt{65}}8$$
Proof:
$$a\sin x + b\cos x = \sqrt{a^2+b^2}\left(\frac{a}{\sqrt{a^2+b^2}}\sin x + \frac{b}{\sqrt{a^2+b^2}}\cos x\right) = \sqrt{a^2+b^2}\sin(x+\theta)$$ where $\theta = \arctan \left(\frac{b}{a}\right)$. Note $-1\le \sin(x+\theta)\le 1$. This proves our claim. We can also figure out that maximum occurs when $\sin(x+\theta)=1$ and minimum when $\sin(x+\theta)=-1$. Thus, you can also figure where the $\max$ and $\min$ are attained.