How many points do $f(x) = x^2$ and $g(x) = x \sin x +\cos x$ have in common? How many points do $f(x) = x^2$ and $g(x) = x \sin x +\cos x$ have in common?
Attempt:
Suppose $f(x) = g(x) \implies x^2 - x\sin x -\cos x = 0$.
Treating it as a quadratic equation in $x$, the discriminant $ = \sin^2x + 4 \cos x = 1-\cos^2x+4 \cos x = 5 - (\cos x -2)^2 \in [-4,1]$.
I don't think this was really helpful. How do I move ahead?
Thank you for your help in this regard.
 A: May be this would  be an idea for you. We have $h(x) =x^2-x\sin x-\cos x$. Then $h'(x)=2x-\sin x -x\cos x +\sin x=x(2-\cos x) $. Hence $h'(x)=0  $ iff $x=0$, and for  $$x<0  \implies  h'(x) <0 \implies h \text{ decreases on } ] -\infty, 0[ $$ and  $$x>0 \implies h'(x)>0 \implies h \text{ increases on } ] 0,\infty[ $$. So $h$ has minimum  at $x=0$ and $h(0)=-1$ . As $h$ has min at -1  and $h$ is continuous  with $h( -2)>0$ and  $h(2)>0$, then $h$ has two roots. 
A: It struck me that I had forgot to take into account how fast these functions were growing. So, I came up with this solution .
$h(x) = x^2 - x \sin x  - \cos x$
$\implies h~'(x) = 2x - x \cos x = x ( 2-\cos x)$
When $ x > 0 : h~'(x) > 0 $ and when $x < 0 : h~'(x) < 0 $.
$h(0) = -1$ and $h(-\pi) = \pi^2 - 1 > 0$
Hence, two solutions. One in $(-\pi,0)$ and the other at some $x > 0 $
A: Hint:
Since they are both even functions, we can focus just on the positive half of the $x$-axis, and replicate our results on the other half at the end. Now,
$$g(x)=x\sin x+ \cos x\leq x\sin x + 1 \leq x + 1$$
