<s>[INST] Proving $a\cos x+b\sin x=\sqrt{a^2+b^2}\cos(x-\alpha)$ 
Show that $a\cos x+b\sin x=\sqrt{a^2+b^2}\cos(x-\alpha)$ and find the correct phase angle $\alpha$.

This is my proof.

Let $x$ and $\alpha$ be the the angles in a right triangle with sides $a$, $b$ and $c$, as shown in the figure. Then, $c=\sqrt{a^2+b^2}$. The left-hand side is $a\cos x+b\sin x=\frac{ab}{c}+\frac{ab}{c}=2\frac{ab}{c}$. The right-hand side is $\sqrt{a^2+b^2}\cos(x-\alpha)=c\left(\cos{x}\cos{\alpha}+\sin{x}\sin{\alpha}\right)=c\left(\frac{ab}{c^2}+\frac{ab}{c^2}\right)=2\frac{ab}{c}$.
Is my proof valid? Is there a more general way to prove it?
For the second part of the question, I think it should be $\alpha=\arccos\frac{a}{\sqrt{a^2+b^2}}=\arcsin\frac{b}{\sqrt{a^2+b^2}}$. Is this correct?
 [/INST] Let $a = r \cos \alpha$ and $b = r \sin \alpha$. Then,
$
a\cos x + b\sin x\\
= r\cos \alpha \cos x + r\sin \alpha \sin x\\
= r \cos (x - \alpha)
$
since we know that $\cos \theta \cos \phi + \sin \theta \sin \phi = \cos (\theta - \phi)$. Now, we already have $a = r \cos \alpha$ and $b = r \sin \alpha$. Squaring and adding both of these,
$
a^2 + b^2 = r^2(\cos^2 \alpha + \sin^2 \alpha) = r^2 \\
\implies r = \sqrt{a^2 + b^2}
$
which gives us our desired result.
</s>