if $f(x)=x^2$ and $g(x)=x\sin x+\cos x$ then number of points where $f(x)=g(x)$? The question is if $f(x)=x^2$ and $g(x)=x\sin x+\cos x$ then number of points where $f(x)=g(x)$?
My approach:-
$$f(x)=g(x)\implies x^2=x\sin x+\cos x\implies x^2-x\sin x-\cos x=0$$
Let $$h(x)=x^2-x\sin x-\cos x$$Now we have to find out roots of $h(x)$.
To do it I differentiate it and get the minimum point of $h(x)$ as follows:-
$$h'(x)=x(2-\cos x)=0\implies x=0 $$or
$$\cos x=2$$, which is impossible. At $x=0 $, $ h(x)=-1<0$. Now in the graph we have one information that the function is minimum on $0$, now where to go from here, what is the next step? 

Equality occurs at the roots of
$$h(x):=f(x)-g(x)=x^2-x\sin(x)-\cos(x).$$
For a continuous function, the minima and maxima alternate and there is at most one root in-between, one before the first and one after the last. A root is there if the function changes sign in the corresponding interval.
Then
$$h'(x)=2x-x\cos(x)=x(2-\cos(x))$$
has a single root at $x=0$ (the other factor cannot change sign).
From
$$h(-\infty)=\infty,h(0)=-1,h(\infty)=\infty$$ we conclude that there are exactly two roots.
