<s>[INST] Maximizing/minimizing $f(\theta) = \sqrt{2}\cos(\theta)-4\sin(\theta)$ 
Assume that $f : [0, 2\pi]\rightarrow \mathbb{R}$ is a function such that $f(\theta) = \sqrt{2}\cos(\theta)-4\sin(\theta)$. Then, how can we maximize/minimize $f$?

We can re-parametrize our function $f$ by defining another function $g : [-1, 1]\rightarrow \mathbb{R}$ function such that for every $t\in [-1, 1]$,
$$g(t) = \sqrt{2}\sqrt{1-t^2}-4t$$
$$\frac{dg}{dt} = \frac{d}{dt}\left(\sqrt{2}\sqrt{1-t^2}-4t\right) = \frac{\sqrt{2}t}{\sqrt{1-t^2}} + 4 = 0$$
From which we conclude that $g$ attains its maximum/minimum at $\left(-\frac{2\sqrt{2}}{3}, g\left(-\frac{2\sqrt{2}}{3}\right)\right), (1, g(1))\in \mathbb{R}^2$ respectively.
 [/INST] Use Cauchy-Schwarz inequality: $f^2(\theta) = \left(\sqrt{2}\cos\theta - 4\sin\theta\right)^2\le ((\sqrt{2})^2+4^2)(\cos^2\theta+\sin^2\theta)=18\implies -3\sqrt{2} \le f(\theta) \le 3\sqrt{2}$. Can you conclude the min and max for $f$?
</s>