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.

$A\cos t+ B \sin t = \sqrt{A^2+B^2} ( \frac{A}{\sqrt{A^2+B^2}} \cos t + \frac{B}{\sqrt{A^2+B^2}} \sin t)$. Choose $\theta$ such that $e^{i \theta} = \frac{A}{\sqrt{A^2+B^2}}  + i\frac{B}{\sqrt{A^2+B^2}} $. Then
$A\cos t+ B \sin t = \sqrt{A^2+B^2} ( \cos \theta \cos t + \sin \theta \sin t) = \sqrt{A^2+B^2} \cos(\theta-t)$.
It follows that the extreme values are $\pm \sqrt{A^2+B^2}$.
