Let
$$f(x) = 2(1+\cos x - x \sin x) \, .$$
The equation $f(x)=0$ has a set of solutions given by $x = (2n - 1)\pi, \, n \in \mathbb{Z}$, easy to find since $\sin x = 0 $ at these roots. To find all solutions we need to solve the equation without any immediate tricks. Reduce
and Solve
are unable to deal with algebraic solutions, so
NSolve[2 (1 + Cos[x] - x Sin[x]) == 0 && 0 < x < 10, x]
=> {{x -> 1.30654}, {x -> 3.14159}, {x -> 6.58462}, {x -> 9.42478}}
Now, it'd be the happiest day of my life to find a complete algebraic solution. I decided to see what I could extract from complexifying $f$, that is,
$$\tilde{f}(\tilde{x}) = 2(1+ e^{i \tilde{x}} + i \tilde{x} e^{i \tilde{x}} ) \, ,$$
where the $\tilde{}$ denotes a complex number (notice both $f$ and $x$ are complexified). It is evident both that $\mathrm{Re}[\tilde{f}] = f$ and that $\tilde{f} = \mathrm{Re}[\tilde{f}] + i\, \mathrm{Im}[\tilde{f}]$.Reduce
works for this case:
Reduce[2 (1 + Exp[I x] + I x Exp[I x]) == 0, x]
=> C[1] \[Element] Integers && x == I - I ProductLog[C[1], -E]
but I have no idea whether or not it is possible to find solutions for the real equation from this complex solution set or if it's just plain useless. Can someone help?
P.S.: I had problems to decide whether or not this question was suited for Math.SE (since it is probably about very basic complex analysis), but since I'm using Mathematica to find the solutions I decided to post it here. Feel free to move it in case it doesn't belong here.
FullSimplify[1 + Exp[I x] + I x Exp[I x] /. x -> (2 k - 1) π, k ∈ Integers]
. $\endgroup$Reduce[]
zeroes the real and the imaginary part simultaneously. The solution you were looking for does not zero the imaginary part. That was my point. $\endgroup$