# Proving that $x\sin x+\cos x=x^2$ has only one positive answer

I have a homework question to prove that

$$x \sin x+\cos x=x^2$$

has only one positive solution.

I have easily proved that it has a positive answer by showing that $f(x)=x\operatorname{sin}x+\operatorname{cos}x-x^2$ is smaller then $0$ at $f(\frac{\pi}{2})$ and larger then $0$ at $f(0)$ and then using the Intermediate Value Theorem.

But I am having trouble proving this is the only positive solution. Can someone help me with this? Thanks :)

-
Examine the derivative of $f$. –  Mikko Korhonen Jan 13 '12 at 12:21
... and use Rolle's theorem. –  lhf Jan 13 '12 at 12:23
Ah Thanks guys - the Rolle's theorem tip helped a lot. –  Jason Jan 13 '12 at 12:36

Let $f(x)=x\sin x+\cos x-x^2$. Then $f(-\pi/2)<0$, $f(0)>0$ and $f(\pi/2)<0$. Hence by the Intermediate Value Theorem, $f$ has at least two zeros. Since $f'(x)=\sin x+x\operatorname{cos}x-\operatorname{sin}x-2x = x\operatorname{cos}x-2x=x(\cos x-2)$, it has only one zero. Therefore $f$ has exactly two zeros where one of them is positive and one of them is negative.
I think you need $-2x$ there. Also, another way: since $x \cos x - 2x = x (\cos x - 2)$ is negative when $x > 0$, we know that $f$ is strictly decreasing in $]0, \infty[$. Thus $f$ has at most one positive root by continuity. –  Mikko Korhonen Jan 13 '12 at 13:24