I'm asked to show there is exactly two values for which $x^2=x\sin x+\cos x$
I have no idea where to start but I was thinking about taking the difference $h(x)=x^2-x\sin x-\cos x$ to show that $h'(x) > 0$ if $x>0$ and $h'(x)<0$ if $x<0$ then since $h(0)<0$ there exists exactly two sets of numbers $[a_1,b_1]$ and $[a_2,b_2]$ such that $h(a_1)>0>h(b_1)$ and $h(a_2)<0<h(b_2)$. Therefore by the intermediate value theorem and since $h$ is continuous there exists exactly two numbers $c_1,c_2$ such that $h(c_1)=h(c_2)=0$ implying these numbers hold true in the proposed statement.
Does this hold as a working proof if I refine it a little more? If there is a more proper way I should be doing this please share your thoughts, thank you.