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: 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}$.
A: If $A=B=0$, then
$$
\min_t(A\cos t+B\sin t)=\max_t(A\cos t+B\sin t)=0.
$$
If $(A,B) \ne (0,0)$, let $\theta \in [0,2\pi)$ such that
$$
\cos\theta=\frac{A}{\sqrt{A^2+B^2}},\quad \sin\theta=\frac{B}{\sqrt{A^2+B^2}}.
$$
Then
$$
A\cos t+B\sin t=\sqrt{A^2+B^2}(\cos t\cos\theta+\sin t\sin\theta)=\sqrt{A^2+B^2}\cos(t-\theta).
$$
Hence
$$
\min_t(A\cos t+B\sin t)=-\sqrt{A^2+B^2},\quad \max_t(A\cos t+B\sin t)=\sqrt{A^2+B^2}.
$$
A: $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}$.
