7

Suppose I have a cubic equation as $$15x^3-4x^2-25x+14=0$$

By Hit and Trial method I know that one of the roots is $x=1$.

And hence I can solve the cubic equation wit ease as it will take the form of $$(x-1)(ax^2+bx+c)=0$$


But what if the cubic equation is $$15 x^3-64 x^2-69 x+70 = 0$$

One of the roots is $x=5$

How do I guess that? Like...I have to try for $x=0,1,-1,2,-2,3,4,5$. It takes time and huge calculations...

I am only talking about simple roots like $x \in \mathbb{Z}$ (integers) and maybe $x \in [-5,5]$ or maybe $x=\frac{1}{2}$ or $x=\frac{-1}{2}$


The methods I am aware of is drawing an approx graph of the cubic equation using maxima/minima or using Newton's method with maybe 2 iterations and check for integers near that.

So are there any easy yet reliable methods of guessing one root.

NeilRoy
  • 2,091

4 Answers4

17

You can use the rational root theorem to guess some roots.

Rational root theorem. All rational roots have the form $\frac{p}{q}$,with $p$ a divisior of the constant term and $q$ a divisior of the first coefficient.

For example, in the integer case, one can take $q=1$, and one only has to test $p = \pm 1$, $p = \pm 2$, $p= \pm 5$, and then you have it. (you of course could test $\pm 7$, $\pm 10$, $\pm 14$, $\pm 35$ and $\pm 70$ as well, but it would be less work to just divide by the $x-5$)

Another technique:

Descartes rule of Signs. The number of positive roots of $P(x)$ is equal to the number of sign changes is the sequence formed by the coefficients of $P(x)$ or it is less by an even number.

The number of negative roots of $P(x)$ is equal to the number of sign changes is the sequence formed by the coefficients of $P(-x)$ or it is less by an even number.

Roots with multiplicity $n$ are counted $n$ times.

In this case it is useless. But if it is a polynomial like $x^3+3x^2+4x+2$, you now know that there are no positive roots.

Last technique:

Estimating roots. If you've tested all eligible roots that are smaller than, say, 10, then you can use this. If the first two coefficients are not extremely small compared to the last two, then its a good idea to look to you eligible roots near to $$-\frac{\mathrm{second} \; \mathrm{coefficient}}{\mathrm{first} \; \mathrm{coefficient}}$$

If the root is larger than 10, the $x^3$ and $x^2$ term are large enough to be able to ignore the smaller terms, thus this is a good estimation. Write $a$ for the first coefficient and $b$ for the second, $c$ for the third and $d$ for the fourth.

Now, if $x$ is large, then $ax^3+bx^2+cx+d \sim ax^3+bx^2$. Therefore the roots will be comparable. But $ax^3+bx^2=0$ gives $x^2=0$ or $ax+b=0$. In the first case $x$ isn't large enough. In the second case we have $ax+b=0$, thus $ax=-b$, thus $x=\frac{-b}{a}=-\frac{\mathrm{second} \; \mathrm{coefficient}}{\mathrm{first} \; \mathrm{coefficient}}$.

wythagoras
  • 25,026
  • The constant term is $70$, so a priori there are several more integers to check: $\pm 7, \pm 10, \ldots$. – Travis Willse Jul 06 '15 at 08:48
  • 2
    @Travis, yes, but then you hit the first integer root and you don't need it anymore. – wythagoras Jul 06 '15 at 08:49
  • Ah, I see, yes, if you take that order, you're done for this polynomial. (+1) – Travis Willse Jul 06 '15 at 08:52
  • Sorry if i am missing something but why not $p=\pm 4 \text{ or } \pm 6$? I mean why only $1,2,5,7,10,...$? – NeilRoy Jul 06 '15 at 09:08
  • 1
    @NeilRoy In your cubic equation, the constant term is 70. 4 and 6 are no divisiors of 70. – wythagoras Jul 06 '15 at 09:09
  • @wythagoras I see... thanks! – NeilRoy Jul 06 '15 at 09:10
  • @wythagoras Sorry for one more question!...But Can i know whether the root is $(-)$ or $(+)$ ? Also when should i stop...(suppose i can do hard calculations easily!) ... like $1,2,5,7,...$...(When should i stop??) – NeilRoy Jul 06 '15 at 09:14
  • @NeilRoy You should stop when you found one root. There is no good way to find out the sign, I think. Unless you can use the Descartes sign rule, but it doesn't always apply (I will edit the answer) – wythagoras Jul 06 '15 at 09:22
  • @wythagoras But suppose i give up after testing for $p=14$ and in reality the root is $p=35$ (next one)...Can I at least guess the proximity/neighborhood of the root? Also what if the constant is a prime number? – NeilRoy Jul 06 '15 at 09:25
  • 1
    @NeilRoy I added something for that as well. – wythagoras Jul 06 '15 at 09:40
  • @wythagoras thanks a lot. – NeilRoy Jul 06 '15 at 09:42
  • Using root radius estimates one gets for the second example that all roots are smaller than $1+max_{k<n}|a_k|/|a_n|=1+70/15=5+2/3$, which excludes the ratios 14 or 35. – Lutz Lehmann Jul 08 '15 at 17:11
  • @wythagoras, could you please explain the logic behind checking roots near (-second coefficient/first coefficient) ? – Rasputin Jul 12 '15 at 12:33
  • @Rasputin Yeah, sure. I will edit. – wythagoras Jul 12 '15 at 13:28
6

You could work by locating the roots approximately by computing at some easy values and noting sign changes - Sturm's Theorem is a heavy duty resource, and Descartes Rule of Signs can be indicative. There are more basic observations too, which can help to narrow the search amongst rational roots - using changes in the sign of the value and the intermediate value theorem.

In this example the polynomial is positive at $x=0, x=-1$ but negative at $x=1$ - so that's located a small positive root. And the polynomial is positive for large $x$ and negative for small (large negative) $x$. Choose $x=\pm10$ as easy to calculate - the value is positive for $x=10$ and negative for $x=-10$.

So if there is an integer root (noting that we've located all three roots approximately) it is greater than $1$ and less than $10$, or less than $-1$ and greater than $-10$ and is a factor of $70$. And every calculation we've done so far has been very easy.

The calculations for $\pm n$ can be done together, because the terms have the same magnitude, and with the options being $2,5,7$ you do $\pm 5$ first because that tells you whether to do $2$ or $7$ if $5$ is a miss.

Mark Bennet
  • 100,194
6

To expand on wythagoras' excellent answer, let me point out that when some of the coefficients are reasonably large (as in this case), we can sometimes relatively quickly extract some more information by reducing the given polynomial $f$ modulo a small integer $m$. This exploits the idea that if $r$ is a root of $f$, so that $f(r) = 0$, then $f(r) \equiv 0 \pmod m$.

Recall (again from wythagoras' answer) that, by the Rational Root Theorem, any integer solution must be a factor of $70$ (or the negative thereof), giving the possibilities $$\pm 1, \pm 2, \pm 5, \pm 7, \pm 10, \pm 14, \pm 35, \pm 70.$$

Now, for example, reducing $f$ modulo $9$ gives $$x \equiv 4, 5 \pmod 9,$$ and this condition leaves only $$\pm 5, \pm 14,$$ already a major reduction.

At this point, we can check these directly, or take another small $m$. (For example, reducing modulo $8$ gives $$x \equiv 1, 5, 6 \pmod 8,$$ which leaves only $$5 \text{ and } 14 .)$$ In short, by making judicious choices, we can radically reduce the number of unpleasant computations involving larger numbers at the cost of doing some easier computations modulo $m$. (Of course, this is begging the question in a way, as we've partially replaced a choice of roots to test with a choice of integers $m$ by which to reduce, but with some practice, the latter computations are very fast anyway, and so even testing increasing small $m$ consecutively perhaps isn't too inefficient.)

Travis Willse
  • 99,363
-1

Considering the equation to be $ax^3+bx^2+cx+d=0$ check for $d$ is product of roots. so you can take the divisors of $d$ for trial Example : $15x^3-64x^2-69x+70=0$ Here the product of the roots is $70$ divisors of $70$ are $1,2,5,7,10,14,35,70$ so you can try these numbers instead of $1,2,3,4,5,6,7,8,9,10$. Make sure you try the negative numbers too.

wythagoras
  • 25,026