<s>[INST] Trigonometry equation maximum Given the equation: $\cos x + \sqrt3 \sin x = a^2$  find the maximum value for $a$ for which the equation has solutions and for this case solve the equation, $a \in \mathbb{R}$.
I'm guessing I need to find the maximum for the function and for this I have to differentiate it and solve it when it's derivative is $0$? At a first glance I'd say the maximum for $a$ is $\sqrt2$ when $x=\frac{\pi}{3}$, but how do I go around proving this? 
 [/INST] Since \begin{align}\cos x+\sqrt 3\sin x &=2\left( \frac 12\cos x+\frac {\sqrt 3}2\sin x \right) \\
& =2 \sin\left(x + \frac{\pi}{6}\right) = a^2\end{align}
Since $\sin x$ oscillates between $-1$ and $1$, we need $\displaystyle -1 \leq \frac{a^2}{2} \leq 1$. The maximum value of $a$ is easily seen to be $a = \sqrt{2}$ since $\displaystyle \frac{a^2}{2}\leq 1 \implies a^2 \leq 2$.

An alternative way (but much less elegant, imo) is to differentiate and set the derivative equal to zero, as shown below: 
$$\dfrac{\mathrm{d}}{\mathrm{d}x}\left(\cos x + \sqrt{3} \sin x\right) = \sqrt{3}\cos x - \sin x.$$
The derivative first vanishes at $x = \frac{\pi}{3}$ and has the general solution of $x = n\pi - \frac{2\pi}{3}$. When $x = \frac{\pi}{3}$, you need only check that this is a maximum point (hint: look at the second derivative) then substitute it into the original equation to deduce that $a^2 = 2$. 
</s>