<s>[INST] Find the maximum and minimum values of $A \cos t + B \sin t$ Let $A$ and $B$ be constants. Find the maximum and minimum values of $A \cos t + B \sin t$.
I differentiated the function and found the solution to it as follows: 
$f'(x)= B \cos t - A \sin t$
$B \cos t - A \sin t = 0 $
$t = \cot^{-1}(\frac{A}{B})+\pi n$
However, I got stuck here on how to formulate the minimum and maximum points. Any explanation would be appreciated.
 [/INST] Let $\displaystyle C = \sqrt{A^2 + B^2}$.
Then $\displaystyle A \cos t + B \sin t = C \left(\frac{A}{\sqrt{A^2+B^2}} \cos t + \frac{B}{\sqrt{A^2+B^2}} \sin t\right)$, and we can visualize a right triangle with opposite $A$ and adjacent $B$ to notice that we can find an angle $\phi$ such that
$\displaystyle \frac{A}{\sqrt{A^2+B^2}} = \sin \phi$
and
$\displaystyle \frac{B}{\sqrt{A^2+B^2}} = \cos \phi$.
This means that $\displaystyle A \cos t + B \sin t = C (\sin \phi \cos t + \cos \phi \sin t) = C \sin (\phi + t)$. Now we can easily see that the maximum is $C = \sqrt{A^2+B^2}$ and the minimum is $-C = -\sqrt{A^2+B^2}$.
And of course, the maximum is reached when $\displaystyle \phi + t = \frac{\pi}{2}$, and the minimum when $\displaystyle \phi + t = \frac{3\pi}{2}$.
</s>