# Guessing bounds for the roots of a function, and counting roots within those bounds

In my book, it's written that we can guess how many roots an equation might have and where they approximately are by its graph or the table of function values without trying to solve it. There's an example afterward, doing that for $f(x)=\sin x -x +0.5=0$ starting from $-1\leq \sin x \leq 1$.

The problem is, it's not always that easy to guess how many roots it has. In the exercise at the end of this section, it's asking about $\sin x=x(x-2)(x-3)$ and $x^2 \cos^2 x-1=0$. I don't know what to do about them and where should I start from.

-
Hint: if you draw the graphs of the function to the left and right of your equations respectively, then a solution is a point of intersection of the graphs. In the first example, $x=0$ is an obvious solution. You may divide by $x$ - the function you then get on the left may be continously extended to $0$, while the function on the right has a parabola as graph. The second one may be rewritten as $cos^2 x = 1/x^2$, both sides of which are easy to visualize. – user20266 Dec 29 '11 at 14:25
@Thomas: Could you tell me what would be the graph of $\cos^2 x$ according to $\cos x$? Or $1/x^2$ according to $x^2$. – Gigili Dec 29 '11 at 14:50
$\cos^2 x=\frac{1+cos 2x}{2}$, so $\cos^2 x$ has half the period, half the amplitude, and is displaced upward so it is tangent to the $x$ axis. $\frac{1}{x}$ is a hyperbola. When you do $\frac1{x^2}$ it has to be greater than 0, go to $\infty$ when $x \to 0$ and goes to $0$ as $x$ gets large in either direction. Why not plot them in Alpha and see? – Ross Millikan Dec 29 '11 at 15:46
@RossMillikan: Aha, great. Thank you. Actually I did it but failed to compare them as you did. – Gigili Dec 29 '11 at 15:59
@Gigili I guess your question is answered by now? – user20266 Dec 29 '11 at 18:38

There are some general rules, but no one specific recipe. For your first, you should think about the fact that $|\sin x | \le 1$ which would lead to the thought that there should be roots near the right side zeros: $0, 2, 3$. As $\sin 0=0$, that is a root and $\sin 3$ is very close to $0$, so the root should be close there. Then you can multiply out the right side: $\sin x=x^3-5x^2+6x$ and see that it gets large and positive as $x \to \infty$ and large and negative as $x \to -\infty$, so there won't be roots too far from the origin. At $x=3$ (the greatest zero of the right), the derivative of the right is $3$, so the right will get greater than $1$ at about $\frac{10}3$ and we can stop looking. Similarly, the derivative of the right at $0$ is $6$, so the right will be less than $-1$ by about $\frac{-1}{6}$. This Alpha graph suggests this is a reasonable guess.
For $x^2 \cos^2 x-1=0$ you can observe that $0$ is not a root and write it as $\cos^2 x=\frac1{x^2}$ or $\cos x=\pm\frac{1}{x}$. The equation is symmetric around $0$ so we will assume $x \gt 0$. There are no roots below $1$ and we can write $\frac2{x^2}=1+\cos 2x$. The left side is positive but decreasing to $0$ and the right side touches $0$ when $x=(n+\frac12 )\pi$. I would expect a pair of roots near each of these points. There is also a single one around $2$ as we get into range.
Thank you for your answer. I don't get why from $|\sin x | \le 1$ you got the result that there should be roots near the right side zeros. Plus that Wolfram Alpha says $x^2 \cos^2 x-1=0$ has six roots, is there a way to guess that? How many roots the equation would have, maximum or minimum number of roots. – Gigili Dec 29 '11 at 16:16
For $|sin x| \lt 1$, that means it is small. So roots will only come when the right side is small as well. For $x^2 cos^2x-1=0$ there are infinitely many roots. I don't get the plot you want from Alpha, but if you look at wolframalpha.com/input/?i=plot+%28cos+%28x+%29^2-1%2F%28x%29%5E2+from‌​1+to+20 you can see it dips below the axis many times. Anywhere $\cos 2x = 0, x^2 \cos^2 x -1 \lt 0$, so there will be another pair of roots around it. – Ross Millikan Dec 29 '11 at 16:46