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?

The proof is only valid for $0<x<\frac\pi2$. For a more general proof, let:
$$a\cos x+b\sin x\ \equiv\ R\cos(x-\alpha)=R\cos\alpha\cos x + R\sin\alpha\sin x$$
So $a=R\cos\alpha$ and $b=R\sin\alpha$, from which you can readily find $R$ and $\alpha$.
