# How to find the zeros of this function?

There is a function, called $f(x)$, where:

$$f(x) = 2(x-a) + 2\cos x (\sin x - b)$$

$a$ and $b$ are constants. I would like to find all the possible values of $x$ where $f(x) = 0$

I've tried to solve it this way:

First I simplified the equation: $$2x - 2a + 2\cos x\sin x - 2b\cos x = 0$$ Then I replaced the $2\cos x\sin x$ to $\sin 2x$, and moved it to the other side: $$2a - 2x + 2b\cos x = \sin 2x$$ After that I used the arcsine function: $$x_1 = \frac{1}{2} \arcsin(2a - 2x + 2b\cos x) + 2n\pi$$ $$x_2 = \pi - \frac{1}{2} \arcsin(2a - 2x + 2b\cos x) + 2n\pi$$

I don't know how to continue it. It is probably a dead end. Could you please give me hints about how should I solve it?

I would like to express $x$ without using $x$.

• Do you have specific values for $a,b$. There will always be at least one solution because $f(x)$ is negative for sufficiently large negative $x$, and positive for sufficiently large positive $x$. But there may be more, depending on $a,b$. Mar 21 '16 at 13:34
• I'd be very surprised if this were possible; this thing is weirdly oscillatory as $a, b$ vary. Mar 21 '16 at 13:47
• Yes, it is easy to find a numerical solution for particular $a,b$, but I cannot see how to get an expression in the general case. Mar 21 '16 at 13:55

This is not an answer (as it does not really solve the stated question), but perhaps the different viewpoint is useful to someone.

The original equation $$2 (x - a) + 2 \cos(x)(\sin(x) - b) = 0$$ can also be simplified to $$x = a + b \cos(x) - \cos(x) \sin(x)$$ and since $\cos(x) \sin(x) = \sin(2 x)/2$, to $$x = a + b \cos(x) - 1/2 \sin(2x)$$ or $$x - a = b \cos(x) - 1/2 \sin(2x) \tag{1}\label{1}$$

This also means that the range of possible solutions are well limited, $$a - \lvert b \rvert - 1/2 \; \le \; x \; \le a + \lvert b \rvert + 1/2$$ i.e. to a $2 \lvert b \rvert + 1$ -sized range around $a$: $$\lvert x - a \rvert \; \le \; \lvert b \rvert + 1/2$$

Note that the left side of equation $\eqref{1}$ is a straight line with slope $1$ ($y = x - a$). The right side is a $2 \pi$-periodic function with amplitude $\lvert b \rvert+1/2$ (unless $b = 0$, in which case the right side is a $\pi$-periodic sine wave with amplitude $1/2$). The solutions are their intersections. When finding numerical solutions for the general case (i.e., $a$ and $b$ are given numerically), this approach yields very good starting points intuitively, so that simple iterative methods can be used to find all solutions rapidly.

Maybe if we think not to resolve in $x$, but taking a solution form to find $a$ and $b$, for example; let be a form solution:

$2(x-a)=0$

and

$2\cos x(\sin x - b)=0$

If we separately solve these equations, we can find an $a$-$b$ relationship that can work to find a solution for the original equation...