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?
The function $h(x)$ is continuous and even. We have $h(0)=-1<0$, $h(\pi)=\pi^2-1>0$, hence by the IVT there is at least one zero $x_0\in(0,\pi)$. For $x>0$ we have $$h'(x)=2x-\sin x-x\cos x+\sin x = x\cdot(2-\cos x)>0$$ so that by Rolle there cannot be two positive zeroes. We conclude that there is exactly one positive zero, by evenness of $h$ also exactly one negative zero, hence exactly two zeroes in total.