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

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

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

enough to prove: $$|a+b|\leq \sqrt{a^2+b^2}$$

But I can find how to continue from here

• $|a+b|\leq \sqrt{a^2+b^2}$ is not true, try $a=3, b=4$ – gammatester Jun 21 '16 at 10:44
• @gammatester Find $x : \sin x = \cos x = 1$... – Abstraction Jun 21 '16 at 10:44
• @Abstraction: That is irrelevant. You cannot prove the inequality, and therefore OP's reasoning cannot be OK. – gammatester Jun 21 '16 at 10:47
• @gammatester Oh, sorry, missed that point. Reasoning is indeed faulty. – Abstraction Jun 21 '16 at 10:49
• – lab bhattacharjee Jun 21 '16 at 10:51

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}

$$|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}$$

• can you please elaborate on the 2 move where did $sin(x+\phi)$ came – gbox Jun 21 '16 at 10:59
• Ok. Let $\frac a{\sqrt{a^2+b^2}}= \sin \phi, \frac b{\sqrt{a^2+b^2}}=\cos \phi$. Really, $$\sin^2 \phi+\cos^2 \phi=\frac{a^2}{a^2+b^2}+\frac{b^2}{a^2+b^2}=1$$ and $|\sin \phi|=\frac a{\sqrt{a^2+b^2}}\le1$ Then $$sin x \sin \phi+\cos x \cos \phi=\sin(x+\phi)$$ – Roman83 Jun 21 '16 at 11:08

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$.

• Don't see any reason for a down vote. Canceling it by a +1. Nice answer – Shailesh Jun 21 '16 at 11:36

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}.$$

$$a\sin{x}+b\cos{x}=\sqrt{a^2+b^2}(\frac{a}{\sqrt{a^2+b^2}}\sin{x}+\frac{b}{\sqrt{a^2+b^2}}\cos{x}$$ now let $$\sin{\alpha}=\frac{b}{\sqrt{a^2+b^2}}$$ then $$\cos{\alpha}=\frac{a}{\sqrt{a^2+b^2}}$$ thus $$a\cos{x}+b\sin{x}=\sqrt{a^2+b^2}\sin({\alpha+x})<\sqrt{a^2+b^2}$$