# Trigonometry/Simplifying a sin(x) + b cos(x)

Consider the function
    $f(x)=a\sin(x)+b\cos(x)$
We shall show that this is a sinusoidal wave
    $f(x)=A\sin(x+\phi )$
and find that the amplitude is $A={\sqrt {a^{2}+b^{2}}}$ and the phase $\phi =\arctan {\frac {b}{a}}$
To make things a little simpler, we shall assume that a and b are both positive numbers. This isn't necessary, and after studying this section you may like to think what would happen if either of a or b is zero or negative.

## Geometric Argument

to-do: add diagram.
We'll first use a geometric argument that actually shows a more general result, that:
    $g(\theta )=a\sin(\theta +\lambda _{1})+b\sin(\theta +\lambda _{2})$
is a sinusoidal wave.
By setting $\lambda _{1}=0^{\circ }\ ,\ \lambda _{2}=90^{\circ }$ , it will follow that $f(\theta )=a\sin(\theta )+b\cos(\theta )$ is sinusoidal.
We use the 'unit circle' definition of sine: $a\sin(\theta +\lambda _{1})$ is the y coordinate of a line of length $a$ at angle $\theta +\lambda _{1}$ to the x axis, from O the origin, to a point A.
We now draw a line ${\overline {AB}}$ of length $b$ at angle $\theta +\lambda _{2}$ (where that angle is measured relative to a line parallel to the x axis). The y-coordinate of $B$ is the y-coordinate of $A$ plus the vertical displacement from $A$ to $B$. In other words its y-coordinate is $g(\theta )$.
However, there is another way to look at the y coordinate of point $B$ . The line ${\overline {OB}}$ does not change in length as we change $\theta$ - all that happens is that the triangle $\Delta OBA$ rotates about O. In particular, ${\overline {OB}}$ rotates about O.
Hence, the y-coordinate of $B$ is a sinusoidal function (we can see this from the 'unit circle' definition mentioned earlier). The amplitude is the length of ${\overline {OB}}$ and the phase is $\lambda _{1}+\angle BOA$ .

## Algebraic Argument

The algebraic argument is essentially an algebraic translation of the insights from the geometric argument. We're also in the special case that $\lambda _{1}=0$and $\angle OAB=90^{\circ }$ . The x's and y's in use in this section are now no longer coordinates. The 'y' is going to play the role of $\lambda _{1}+\angle BOA$ and the 'x' plays the role of $\theta$ .
We define the angle y by $\tan(y)={\frac {b}{a}}$ .
By considering a right-angled triangle with the short sides of length a and b, you should be able to see that
    $\sin(y)={\frac {b}{\sqrt {a^{2}+b^{2}}}}$ and $\cos(y)={\frac {a}{\sqrt {a^{2}+b^{2}}}}$ .
* Check this
* Check that $\sin ^{2}(x)+\cos ^{2}(x)=1$ as expected.
    ${\begin{aligned}f(x)&=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}}}{\Big\sin(x)\cos(y)+\cos(x)\sin(y){\Big )}\\&={\sqrt {a^{2}+b^{2}}}\sin(x+y)\\&=A\sin(x+\phi )\end{aligned}}$ ,
which is (drum roll) a sine wave of amplitude $A={\sqrt {a^{2}+b^{2}}}$ and phase $\phi =y$.
* Check this
* Check each step in the formula.
* What trig formulae did we use?
* The more general case
* Can you do the full algebraic version for the more general case:
* $g(\theta )=a_{1}\sin(\theta +\lambda _{1})+a_{2}\sin(\theta +\lambda _{2})$
* using the geometric argument as a hint?
* It is quite a bit harder because $\triangle OBC$ is not a right triangle.
* What additional trig formulas did you need?