# How to show that an equation has exactly two solutions?

I have the equation $$x^2 + x \cos(x) = 1 + \sin(x)$$ and I need to prove that it has exactly two solutions.
What I used to do before when I had to prove an equation has one solution was:
used the intermediate value theorem to show there exists a solution and then used contradiction with Rolle's theorem to show that there's a unique one. But here I'm not so sure what to do.

Thanks for the help!

• Please, if you are ok, you can accept the answer and set it as solved. Thanks! – user Feb 3 '18 at 23:53

Let $f(x) = x^2 + x\cos(x) - \sin(x) - 1$. Then, $f'(x) = 2x - x \sin(x) = x(2 - \sin(x))$.

Now, $2 - \sin (x)$ is always positive, so the sign of $f'(x)$ is just the sign of $x$. In particular, the only root of $f'(x)$ is $0$.

Between any two roots of $f(x)$, there must be a point of zero derivative, by mean value theorem.

If there are more than two roots, then $f'(x)$ would have more than one root, contradiction.

Carefully apply intermediate value theorem and you shall be able to prove that two roots actually exist.

• what would you say f(a) and f(b) are in this situation though? – Nicole Jan 6 '18 at 12:08

You can differentiate, study the variations of the function and use two times the intermediate value theorem. ( by finding four wisely chosen points ) The representation will help you

• youre suggesting i first differentiate? i have to firstly show there exists a solution no? – Nicole Jan 6 '18 at 11:59

Consider $f(x)=x^2+xcosx-1-sinx$. We want to show that it has exactly two roots. First let's calculate its derivative: $$f^{'}(x)=2x-xsinx=x(2-sinx)$$ here we find out that the function is strictly increasing when $x>0$ and strictly decreasing when $x<0$ and $f(0)=-1$. Then two strict branches come up from $(0,-1)$ and intersect with x-axis at exactly two points.

A possible strategy is to consider the function

$$f(x)=x^2 + x \cos(x)- \sin(x)-1$$

and show that it has only two intersection point with $x$ axis.

Note that

$$x\to\pm\infty \quad f(x)\to+\infty$$

and

$$f'(x)=2x-x\sin x=x(2-\sin x)$$

thus

$$f'(x)=0\iff x=0 \quad f(0)=-1$$

$$f'(x)>0\iff x>0$$

$$f'(x)<0\iff x<0$$

Now use IVT to show that f has exactly two intersection point with x axis.

• yeah thats my problem, how do i show it has exactly two intersection points? since we havent done investigations of functions yet.. – Nicole Jan 6 '18 at 11:57
• @Nicole you need to investigate the function by derivative – user Jan 6 '18 at 11:58
• i see what youre saying but then the function is equal to -1 whereas if you consider the function to be what you said then the solutions would need to make f(x) = 0 , if im not mistaken? – Nicole Jan 6 '18 at 12:04
• @Nicole f has a negative minimum at x=0 and is positive for some x>a and x<b thus, since it is strictly increasing for x>o and strictly decreasing for x<0 it easy to show that f has necessarly only two intersection with x axis. – user Jan 6 '18 at 12:09

Let $f(x)=x^2+x\cos{x}-\sin{x}-1.$

Thus, for all $|x|\geq\sqrt3$ by C-S we obtain $$f(x)=x^2-1-(\sin{x}-x\cos{x})\geq$$ $$\geq x^2-1-\sqrt{(\sin^2x+\cos^2x)(1^2+(-x)^2)}=x^2-1-\sqrt{1+x^2}=$$ $$=\frac{x^2(x^2-3)}{x^2-1+\sqrt{1+x^2}}\geq0.$$ The equality does not occur, which says that the equation $f(x)=0$ has no roots for $|x|\geq\sqrt3$.

In another hand, by C-S again for $|x|\leq\sqrt3$ we obtain $$f''(x)=2-(\sin{x}+x\cos{x})\geq2-\sqrt{(\sin^2x+\cos^2x)(1+x^2)}=2-\sqrt{1+x^2}\geq0,$$ which says that $f$ is a convex function on $[-\sqrt3,\sqrt3]$, which gives that $f$ has there at most two roots.

The rest is smooth:

$f(-\pi)>0$, $f(0)<0$ and $f(\pi)>0$, which says that $f(x)=0$ has two roots exactly.

• what is c-s? sorry for the ignorance – Nicole Jan 6 '18 at 12:55
• I guess he means to say Cauchy Schwartz – Rohan Shinde Jan 6 '18 at 14:58