trigonometric inequality bound? Suppose that one wants to determine an upper bound of the trigonometric expression
$$
a\sin(x)+b\cos(x),
$$
where $a,b\in\mathbb{R}$. My instinct is to proceed as follows:
$$
a\sin(x)+b\cos(x)\leq |a|+|b|,
$$
which is correct. If one were to drop the modulus signs, would that make the bound incorrect?
 A: the conservative(naive) upper bound $|a| + |b|$ is too big because $\sin x$  and $\cos x$ cannot be both max or both min simultaneously.  the reason is the ever present constraint $$\sin^2 x +\cos^2 x = 1.$$
what happens is $$\begin{align}a\sin x  + b \cos x &= \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) \\ 
&=\sqrt{a^2+b^2}\cos(x-t), \cos t = \frac b{\sqrt{a^2 + b^2}}, \sin t = \frac a{\sqrt{a^2 + b^2}}\end{align}$$
therefore $$\lvert a\cos x + b\sin x \rvert \le \sqrt{a^2 + b^2.}$$
A: We can write $a\sin x+b\cos x=C \sin(x+y)$ where $C=\sqrt{a^2+b^2}$ and $y=\arctan (b/a)$ with the arctangent function accounting for the individual signs of $a$ and $b$ (see Note).  

Thus, the maximum is $C=\sqrt{a^2+b^2}$.


NOTE:
We can see that this is correct using only the addition angle formula for the sine function along with the identity $\sin^2 x+\cos^2 x=1$.  Write
$$C\sin(x+y)=(C\cos y)\sin x+(C\sin y)\cos x \implies a=C\cos y \,\,\text{and,}\,\, b=C\sin y$$  
Solving for $C$ we have $C^2=a^2+b^2\implies C=\sqrt{a^2+b^2}$.  
Solving for $-\pi\le y\le \pi$ we have $\tan y=b/a \implies y=\arctan (b/a)$ for $a>0$, $y=\arctan(b/a)+\pi$ for $a<0$ and $b>0$, and $y=\arctan(b/a)-\pi$ for $a<0$ and $b<0$.
A: hint: Use CS inequality: $|pm+qn| \leq \sqrt{p^2+q^2}\cdot \sqrt{m^2+n^2}$ with $m = \sin x, n = \cos x, p = a, q = b$
A: There are several ways, including a geometric way, to think about this bound. We can just do this the good ol' calculus way. For now, I'll just assume that $a$ and $b$ are positive.
Taking the derivative, we have $a \cos{x} - b \sin{x} = 0 \rightarrow \tan{x} = \dfrac{a}{b}$ This means that $\cos{x} = \dfrac{b}{\sqrt{a^2 + b^2}}$ and $\sin{x} =\dfrac{a}{\sqrt{a^2 + b^2}}$ .
At this point, we have $a\sin{x} + b\cos{x} = \dfrac{a^2 + b^2}{\sqrt{a^2 + b^2}} = \sqrt{a^2 + b^2}$.
You can extend this to show that the maximum is $\sqrt{a^2 + b^2}$ for any real $a$ and $b$.
