The function is $\sin{(\theta)}-\sqrt{\theta}\cos{(\theta)}$ where $\theta \in [0, 2\pi[$
The question is to find the maximum. My approach was to think about the value of $\theta$ that would maximize $\sin{(\theta)}$ and minimize $\cos{(\theta)}$, but the correct answer is 2, I plotted it with the computer. How do I find this answer ?
The function $$f(\theta)=\sin{(\theta)}-\sqrt{\theta}\cos{(\theta)}$$ will go through a maximum or a minimum when its first derivative will be equal to $0$. Then, we have $$f'(\theta)=\sqrt{\theta} \sin (\theta)-\frac{\cos (\theta)}{2 \sqrt{\theta}}+\cos (\theta)$$ which is not the most pleasant equation to solve. Looking at its plot, we can see that it cancels close to $0.2$, $2.7$ and $6.0$. To these three points correspond respectively a minimum, a maximum and a minimum of the function. Starting from $\theta=2.7$, Newton iterative method converges to $f'(\theta)=0$ for $\theta=2.74267$ and, for this value, $f(\theta)=1.91449$.