Prove: $|a\sin x+b \cos x|\leq \sqrt{a^2+b^2}$

Solution 1:

Use Cauchy-Schwarz inequality : \begin{align}|a\sin x+b \cos x| = |(a,b)\cdot (\sin x,\cos x)| &\leq \sqrt{a^2+b^2}\sqrt{\sin^2 x+\cos^2 x}=\sqrt{a^2+b^2}.\end{align}

Solution 2:

$$|a \sin x + b \cos x|=\big|\sqrt{a^2+b^2}\left(\frac a{\sqrt{a^2+b^2}}\sin x+\frac b{\sqrt{a^2+b^2}}\cos x\right)\big|=$$ $$=\sqrt{a^2+b^2}|\left(\sin(x+\phi)\right)|\le\sqrt{a^2+b^2}$$

Solution 3:

Find the extrema of

$$a\cos(x)+b\sin(x).$$

By canceling the derivative,

$$-a\sin(z)+b\cos(z)=0$$ or$$\tan(z)=\frac ba.$$

Then, with

$$\cos(z)=\pm\frac1{\sqrt{\tan^2(z)+1}}=\pm\frac a{\sqrt{a^2+b^2}},\\\sin(z)=\pm\frac{\tan(z)}{\sqrt{\tan^2(z)+1}}=\pm\frac b{\sqrt{a^2+b^2}},$$

you obtain

$$a\cos(z)+b\sin(z)=\pm\sqrt{a^2+b^2}.$$

Then for all $x$,

$$-\sqrt{a^2+b^2}\le a\cos(x)+b\sin(x)\le\sqrt{a^2+b^2}.$$

Solution 4:

Take two vectors: $v_1 = (a,b)$ and $v_2 = (\sin x, \cos x)$. Their scalar product is $(v_1, v_2) = |v_1||v_2|cos(\phi) = a \sin x + b \cos x$ where $\phi$ is the angle between $v_1$ and $v_2$, but $|v_1| = \sqrt{a^2 + b^2}, |v_2| = 1$.