# Deriving the sum of sin and cos formula

## Homework Statement

Show that ##a \sin x + b\cos x = c \sin (x + \theta)##, where ##c = \sqrt{a^2 + b^2}## and ## \displaystyle \theta = \arctan (\frac{b}{a})##

## The Attempt at a Solution

We see that ##c \sin (x + \theta) = c \cos \theta (\sin x) + x \sin \theta (\cos x)##. So we compare coefficients. ##a = c \cos \theta## and ##b = c sin \theta##. We can assume that neither ##a## or ##b## are zero, so we find by division that ##c = \sqrt{a^2 + b^2}##. Next, we see that ##a^2 + b^ = c^2 \cos^2 \theta + c^2 \sin^2 \theta = c^2##, so ##c = \pm \sqrt{a^2+b^2}##. So it seems that I am done, since the we can take the positive root. However, what about the negative root? Would that give a valid answer too? Why isn't the negative root the one that is desired by the question?

So we compare coefficients. a=ccosθa=ccos⁡θa = c \cos \theta and b=csinθb=csinθb = c sin \theta. We can assume that neither aaa or bbb are zero, so we find by division that c=√a2+b2c=a2+b2c = \sqrt{a^2 + b^2}.

I think you mean "so we find by division that ##\theta = \arctan(b/a)##.

I can think of two ways why ##c >0 ##

First because the term on LHS is the equation of a straight line in polar coordinates and ##c## corresponds to ##r## in polar. Since ##r## is always +ve and thus so is ##c##.

Second, for given ##a,b > 0## you can always construct a right triangle with ##h = \sqrt{a^2 + b^2}##. (h is hypotenuse).

So we can write ##a\sin x + b\cos x = \sqrt{a^2 + b^2}\left({a\over \sqrt{a^2 + b^2}}\sin x + {b\over \sqrt{a^2 + b^2}}\cos x\right)##

Lets angle between ##h## and ##a## as ##\theta##, So we get ##\cos \theta = {a\over \sqrt{a^2 + b^2}}, \ \ \ \sin \theta = {b\over \sqrt{a^2 + b^2}}## and ##\tan \theta = {b \over a}##

From here we can get,##\theta = \arctan(b/a)##,

And ##\sqrt{a^2 + b^2}\left({a\over \sqrt{a^2 + b^2}}\sin x + {b\over \sqrt{a^2 + b^2}}\cos x\right) = \sqrt{a^2 + b^2}\left(\cos \theta\sin x + \sin \theta\cos x\right) = \sqrt{a^2 + b^2}\sin (\theta + x)##

From here you can see ## c = h = \sqrt{a^2 + b^2}##, and hypotenuses are not negative, Do they ?