Show that $x^2-\cos(x)$ has two roots in the real numbers I'm stuck in a problem. I have to show that the function $f:\;\mathbb{R}\rightarrow\mathbb{R}$, defined by $f(x)=x^2-\cos(x)$ has exaclty two roots in the real numbers. 
It's also specified, as a remark, that $f$ is a function of class $C^m$. 
 A: Well, if
$f(x) = x^2 - \cos x = 0, \tag{1}$
then
$x^2 = \cos x, \tag{2}$
so
$\vert x \vert^2 = \vert x^2 \vert = \vert \cos x \vert \le 1; \tag{3}$
thus any solution must satisfy
$\vert x \vert \le 1, \tag{4}$
or
$-1 \le x \le 1.  \tag{3}$
Let's look at the case $x \ge 0$; we have
$f(0) = -1, f(1) = 1 - \cos 1 > 0, \tag{4}$
since $1 < \pi / 2$; now by the intermediate value theorem we must have $f(x_0) = 0$ for some $x_0 \in (0, 1)$.  Since $x^2$ increases and $\cos x$ decreases, both monotonically, on $(0, 1)$, there can only be this one point $x_0$ where their graphs intersect; only one point where $f(x_0) = 0$.  Now use reflection symmetry across the $y$-axis (i.e., that $f(x)$ is even) to see that $-x_0$ is the only other solution.
We didn't even need the fact that $f(x) \in C^m$, though in fact it is analytic!
A: It's easy to verify that $f$ is an even function. Thus if $z$ is a root, then $-z$ is also a root. We only need to show that there is exactly one positive value for $z$. (Then the other one is of course $-z$.)
We can write $f(x) = 0$ or $x^2 = \cos(x)$. Then we know that $x$ is between $0$ and $1$, since $|\cos(\cdot)|\leq 1$. But because $x^2$ is strictly increasing in this domain and $\cos(\cdot)$ is strictly decreasing, we can only find one solution. In the other (positive) domains, $x^2>cos(x)$ since $x>1\implies x^2>1 \implies x^2>\cos(x)$.
Hence, there are exactly two solutions.
A: Notice, in order to check the real roots of $f(x)=x^2-\cos x$ we have $$x^2-\cos x=0\iff x^2=\cos x$$
the graphs of $y=x^2$ & $y=\cos x$ intersect each other at two different real points $x=0.824132$ & $x=-0.824132$
See in the graph below

A: Note that both the functions are even, the difference function passes from positive, zero, negative, zero and back again to positive. There would hence be ( at least ) two roots of same magnitude but opposite sign.
