# Alternative deduction of sum of sine and cosine

1. May 26, 2014

### nickek

Hi!
Many students know that $A\sin(x) + B\cos(x) =\sqrt{A^2+B^2} \sin{(x+\arctan \frac{B}{A})}$. I have seen just one deduction of that relation, showed by set up a system of two equations, solving for amplitude and phase shift.

Is it possible to deduce the relation in a vectorial way, or in any way including complex numbers? The cosine part on the x-axis and the sine-part on the y-axis, the resultant vector should be the sum of the given trigonometric functions. But the magnitude of that resultant vector becomes $\sqrt{(A\sin{x})^2+(B\cos{x})^2}$, which is not equal to the actual magnitude of the sum.

What am I missing in this kind of deduction? Or maybe it's not possible?

2. May 26, 2014

### Einj

I can prove it backward using complex numbers. The Euler formula says $\sin x=\frac{e^{ix}-e^{-ix}}{2i}$ and $\cos x=\frac{e^{ix}+e^{-ix}}{2}$. Moreover you have $\arctan x=\frac{1}{2}i\left[\log(1-ix)-\log(1+ix)\right]$. Then in your case:
\begin{align*}
\sin(x+\arctan(B/A))=&\frac{e^{ix}e^{-\frac{1}{2}\log(1-B/A)}e^{\frac{1}{2}\log(1+iB/A)}-e^{-ix}e^{\frac{1}{2}\log(1-B/A)}e^{-\frac{1}{2}\log(1+iB/A)}}{2i} \\
=&\frac{e^{ix}\sqrt{\frac{1+iB/A}{1-iB/A}}-e^{-ix}\sqrt{\frac{1-iB/A}{1+iB/A}}}{2i}=\frac{e^{ix}\left(\frac{1+iB/A}{\sqrt{1+B^2/A^2}}\right)-e^{-ix}\left(\frac{1-iB/A}{\sqrt{1+B^2/A^2}}\right)}{2i} \\
=&\frac{e^{ix}(1+iB/A)-e^{-ix}(1-iB/A)}{2i}\frac{A}{\sqrt{A^2+B^2}}=\frac{A(e^{ix}-e^{-ix})+iB(e^{ix}+e^{-ix})}{2i}\frac{1}{\sqrt{A^2+B^2}} \\
=&\left(A\sin x+B\cos x\right)\frac{1}{\sqrt{A^2+B^2}}.
\end{align*}

I hope this is clear.

3. May 27, 2014

### AlephZero

You can show it geometrically on an Argand diagram. $\sin x = \cos(x - \pi/2)$, so start with the equivalent expression, the real part of $Ae^{i(x-\pi/2)} + Be^{ix}$.

If you draw $Ae^{i(x-\pi/2)}$ and $Be^{ix}$ on an Argand diagram, for an arbitrary choice of $x$, you have a right angled triangle with sides $A$ and $B$. The result follows from Pythagoras's theorem and simple trig.