Roots of trigonometric function.

I have a function:

$f(x) = (ax+b) \cdot \sin(x) + (cx+d) \cdot \cos(x) + e$

for which I want to determine the roots.

I know that for $ax \cdot \sin(x) + cx \cdot \cos(x)$

the roots are $2(\tan^{-1}(\frac{a \pm \sqrt{a^2+c^2}}{c})+\pi n)$

and for $b\cdot \sin(x) + d \cdot \cos(x)$

the roots are $2(\tan^{-1}(\frac{b\pm\sqrt{b^2+d^2}}{d})+\pi n)$

but I have some trouble in finding the roots of the sum of both. Can anybody explain how to find it?

• One way is to expand the original equation using the identity $sin^2(x)+cos^2(x)=1$, to get an equation in $sin^2(x)$ only, let then let $u=sin^2(x)$ and solve the resulting Quadratic expression using Quadratic formula Feb 11, 2016 at 12:42
• @NoChance I am not sure if I can follow you, but this sounds a little too easy for this problem, since the zeroes for a simpler form ($ax\cdot\sin(x)+cx\cdot\cos(x)$) is already more complicated than this
– Ctx
Feb 11, 2016 at 12:56
• Not sure what is not clear but here is what I think: $f(x) = (ax+b) \cdot \sin(x) + (cx+d) \cdot (1-sin^2(x)) + e$ now let $u(x)=sin(x)$ to get: $f(x) = (ax+b) u + (cx+d) (1-u^2) + e$. This can be solved using quadratic formula. Feb 11, 2016 at 13:03
• Because of the terms $x\,\sin x$ and $x\,\cos x$ there is no hope of obtaining a formula or the roots. Consider for instance $x\,\sin x+1=0$. Can you give a formula for the roots of the equation? Feb 11, 2016 at 13:19
• @JuliánAguirre I indeed feared that this is the case. Any suggestions on how to find the roots numerically? I know newton-raphson, but I have some trouble to reliably find good starting points
– Ctx
Feb 11, 2016 at 13:28

Because of the terms $x\,\sin x$ and $x\,\cos x$ there is no hope of obtaining a formula or the roots, not even for the simple looking equation $x\,\sin x+1=0$. Because $f$ is unbounded and oscillating (if $|a|+|b|\ne 0$), there will be an infinite number of roots.
If you want to use numerical methods, say Newton's method, you need a good guess to give as initial value. You can locate zeros plotting $f$ or evaluating $f$ at some points. Good candidates are points $x$ where $\sin x=0,1,-1$, that is $\dfrac{k\,\pi}2$, $k\in\mathbb{Z}$.
As already answered by Julián Aguirre, equations which contains polynomial and trigonometric functions do not show explicit solutions (this is already the case for $x=\cos(x)$) and only numerical methods could find the roots (one at the time because there is an infinite number of solutions).
If you located one root, probably the simplest would be Newton method which, starting from a "reasonable" guess $x_0$, will update it according to $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$
Let us consider the case of the equation you gave and use $a=1,b=2,c=3,d=4,e=5$ and we look for the root located close to $x_0=15$. The iterates will be $$x_1=14.5438284668645$$ $$x_2=14.5706131998069$$ $$x_3=14.5705976124983$$ $$x_4=14.5705976124952$$ which is the solution for fifteen significant figures.