How to get the $\phi$ from $a\sin(x)+b\sin(x+\theta)=c\sin(x+\phi)$? $a\sin(x)+b\sin(x+\theta)=c\sin(x+\phi)$,
where $c=\sqrt{a^2+b^2+2ab\cos(\theta)}$, and $\displaystyle\tan(\phi)=\frac{b\sin(\theta)}{a+b\cos(\theta)}$.
I want to know how to get to this result.
I'm able to derive $c$ by taking the derivative of the equation, then squaring both and adding them together, and back-substituting the cosine of a double angle.
But how does one get to the expression for $\tan(\phi)$?

Use the sin addition formula $\sin(\alpha+\beta)=\sin \alpha \cos \beta + \cos \alpha \sin \beta$
\begin{eqnarray*}
a \sin x + \underbrace{b \sin(x+\theta)}_{ b\sin x \cos \theta+b \cos x \sin \theta}= \underbrace{c \sin(x+ \phi)}_{b\sin x \cos \phi+b \cos x \sin \phi} \\
(a +  b \cos \theta) \color{red}{\sin x} + b \sin \theta \color{blue}{\cos x} = c \cos \phi \color{red}{\sin x}+c  \sin \phi \color{blue}{\cos x}
\end{eqnarray*}
Equate the coefficients of $ \sin x $ and $ \cos x $
\begin{eqnarray*}
a +  b \cos \theta = c \cos \phi \\
b \sin \theta  =c  \sin \phi
\end{eqnarray*}
Now square these equations and add to get the first equation you want. & take the ratio of these equations to get the second equation.
