How to find the number of roots of the equation $4\cos(e^x)=2^x+2^{-x}$? 
How to find the number of roots of the equation $4\cos(e^x)=2^x+2^{-x}$?

Generally, for these kinds of problems I used to draw the graphs of the functions on either sides of the equation. Then find the number of points where they intersect each other, and hence the number of roots.
But here, I face difficulty in drawing both the graphs of the functions (to actual scale) to determine the number of roots. I was able to somehow draw the graphs, but I don't know to draw them accurate enough to determine the number of roots. So,I used graphing calculator to determine the graphs and hence the number of roots as follows:

Clearly, the number of roots is $4$.
Is there any other method of finding the number of roots of the given equation? If you are using the graphical method, please give some guidance on how to plot the graphs of such complicated functions (eg. $4\cos (e^x)$) accurate enough to determine the number of intersection points.
 A: With the transformation $x\to\ln x$ we get an equivalent problem: 

$$\cos x = \frac{1}{4}(x^{\ln 2}+x^{-\ln 2})~~,~~~~x>0$$ 

$\displaystyle x>0 : \enspace \cos x = \frac{1}{4}(x^{\ln 2}+x^{-\ln 2}) > 0$
Roots can only exist for $\displaystyle ~0<x<\frac{\pi}{2}~$ and $\displaystyle ~\frac{3\pi}{2}<x<\frac{5\pi}{2}~$,  
because it’s $\displaystyle ~\cos x \leq 1 < \frac{1}{4}(x^{\ln 2}+x^{-\ln 2})~$ for $\displaystyle ~x\geq\frac{5\pi}{2}~$ .
$\text{(A)}:~~\displaystyle~0<x<\frac{\pi}{2}$ 
$\displaystyle\frac{d^2}{dx^2}\cos x = -\cos x < 0 ~$ means that $\,\cos x\,$ is concave. 
$\displaystyle\frac{d^2}{dx^2}( x^{\ln 2}+x^{-\ln 2}) > 0~$ means that $~ x^{\ln 2}+x^{-\ln 2}~$ is convex
Therefore we can have maximal $\,2\,$ roots.
$\displaystyle x:=0.1 : \enspace \cos x < \frac{1}{4}(x^{\ln 2}+x^{-\ln 2})$
$\displaystyle x:=\frac{\pi}{4} : \enspace \cos x > \frac{1}{4}(x^{\ln 2}+x^{-\ln 2})$
$\displaystyle x:=\frac{\pi}{2} : \enspace \cos x < \frac{1}{4}(x^{\ln 2}+x^{-\ln 2})$
$=>~~~2~$ roots
$\text{(B)}:~~ \displaystyle~\frac{3\pi}{2}<x<\frac{5\pi}{2}$
$0<a<1 : ~~\cos x = a~$ has $~2~$ roots
$x^{\ln 2}+x^{-\ln 2}~$ is strictly monotonously increasing.
$\displaystyle x:=\frac{3\pi}{4} : \enspace \cos x < \frac{1}{4}(x^{\ln 2}+x^{-\ln 2})$
$\displaystyle x:=2\pi : \enspace \cos x > \frac{1}{4}(x^{\ln 2}+x^{-\ln 2})$
$\displaystyle 2\pi<x:=6.68 < \frac{5\pi}{4} : \enspace \cos x < \frac{1}{4}(x^{\ln 2}+x^{-\ln 2})<1$ 
$=>~~~2~$ roots
Solution: $~$ With $\text{(A)}$ and $\text{(B)}$ we get $4$ roots.
A: Define 
$$
f(x) = 2^x-2^{-x}
$$
$$
g(x) = 4 \cdot cos(e^x)
$$
Note $f$ is convex and symmetric around the $y$-axis. It is thus shaped like a parabola. Futhermore
$$
4 \leq g(x) \leq 4 \quad \forall x
$$
So only when $f(x) \leq 4$ can the curves intersect.
Solving $f(x) = 4$ gives 
$$
x_1 = \log_{2} (2-\sqrt{3}), x_2 = \log_{2} (2+\sqrt{3})
$$
We can now calculate the number of periods of $g(x)$ in this interval.
$$
\frac{e^{x_2} - e^{x_1}}{2 \pi} \approx 1.04
$$
Meaning the function undergoes a little bit more than 1 period of the the cosine. You can deduce the shape of $g(x)$ in this interval by for example calculating $g'(x_1)$ and seeing it will first decrease.
Since
$$
f(x_2) > g(x_2)
$$
we have at least 2 roots, namely the 2 rightmost points of intersection.
You can show the existence of the first 2 points of intersection with a little heuristic, try a few values, for example, $0$ and show that $f(0) < g(0)$. Since $g(x_1) < f(x_1)$ this means another point of intersection lies somewhere between $x = x_1$ and $x = 0$. This proves the existence of the left most point of intersection. And because $g'(0) < 0$, $g(x)$ is still decreasing towards $-4$ and will intersect $f(x)$ one more time.
A: Note $f(x)=4\cos(e^x)-2^x-2^{-x}$ . It is clear, because of the function $g(x)=2^x+2^{-x}$, that between every two consecutive roots of $h(x)=\cos(e^x)$  there is a single maximum or a single minimum of f (x), furthermore to each maximum of $h(x)$ it correspond a maximum of $f(x)$ and, likely, to each minimum of $h(x)$ it correspond a minimum of $f(x).$
The first three roots of $h(x)$  are taken at $x_1,\quad x_2,\quad x_3$ such that 
$e^{x_1}=\dfrac{\pi}{2},\quad e^{x_2}=\dfrac{3\pi}{2},\quad e^{x_3}=\dfrac{5\pi}{2}$ (that is $x_1\approx0.45\quad x_2\approx1.56\quad x_3\approx2.06$) and we have $f(x_i)\lt0;\quad i=1,2,3$.
Because of $f(-2)\lt0\quad f(0)\gt0\quad f(x_1)\lt0$ there are two roots of $f(x)$ in the interval $(-2,x_1)$ and a minimum of $f(x)$ in the interval $(x_1,x_2)$. Then a maximum in the interval $(x_2,x_3)$. If we have an $x\in (x_2,x_3)$ such that $f(x)\gt0$ then there are two more roots in the interval $(x_2,x_3)$, otherwise it would be only two roots of $f(x)$.The value $x=1.8$ works for that, one has $f(1.8)\gt0$.
This finish the proof because $f(x)\lt0$ for all x such that $|x|\gt2$.
