Don't know how to approach $x \cos(x) - 2 \cos^2(x) = 2$ I don't how to solve for $x$ because of the mixture of trig and $x$ outside a trig function. Can someone give me a hint how to proceed?
$$x \cos(x) - 2 \cos^2(x) = 2$$ where the interval is $[0,2\pi]$
 A: If $x$ is both inside and outside of trigonometric functions, don't look for an explicit solution in  ̲g̲e̲n̲e̲r̲a̲l̲ ̲c̲a̲s̲e̲.
You should use numerical methods in such cases.
If you just look for the answer and the solution method is not important to you, here is the wolfram link showing that there is a root $x\approx5.2$ in this interval.
First note that for nonzero $\cos x$, this reduces to $$x=2\Big(\cos x + \frac{1}{\cos x}\Big)$$ where the right hand side lies in the interval $(-\infty, -4]\cup [4, \infty)$ from the AM-GM inequality. Hence, positive $x$ must be greater than 4. Additionally see that for $f(x) = x\cos x-(2\cos^2 x+2)$, $f(0)=-4 <0$ and $f(2\pi)\approx 2.28 > 0$. Hence, by the intermediate value theorem,$f(x)$ must have a root in $(0, 2\pi)$. So, a root lies in $[4,2\pi)$. Next, use numerical methods to find the root.
The best method is to iterate. A possible starting value is $x_1 = 5$ 
$$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$
$$f(x)=x \cos(x) - 2 \cos^2(x) - 2$$
$$f'(x)=-x \sin(x)+2 \sin(2 x)+\cos(x)$$
Stop when $x_n = x_{n-1}$
more details.

And here there is a C++ code for the implementation. As you see the output result is $x=5.200801328145019$ you can increase the precision.
