Algebra · real student question

Solve the cubic 1.5708x^3 - 0.01446x^2 + 1.35803e-5 x + 1.0159097e-12 = 0.

Question

Solve for xx:

1.5708x30.01446x2+1.35803×105x+1.0159097×1012=01.5708x^3-0.01446x^2+1.35803\times10^{-5}x+1.0159097\times10^{-12}=0

Step-by-step solution

  1. Read the scale off the coefficients before touching a solver. The coefficients drop by roughly two decades per degree (1.571.57, 1.4×1021.4\times10^{-2}, 1.4×1051.4\times10^{-5}), which is the fingerprint of roots near 10210^{-2} to 10310^{-3}. The constant term is a further seven decades smaller, so one root must be far tinier than the other two.

  2. Rescale to a well-conditioned cubic. Substituting x=t/1000x=t/1000 multiplies the tkt^k coefficient by 10003k1000^{3-k}:

    1.5708t314.46t2+13.5803t+1.0159097×103=01.5708t^3-14.46t^2+13.5803t+1.0159097\times10^{-3}=0

    Now every coefficient sits within a couple of orders of magnitude, so a root finder loses far less precision to cancellation.

  3. Locate the two large roots by sign changes. With g(t)=1.5708t314.46t2+13.5803t+0.0010159097g(t)=1.5708t^3-14.46t^2+13.5803t+0.0010159097: g(1)=0.6921>0g(1)=0.6921>0, g(1.5)=6.8621<0g(1.5)=-6.8621<0, g(8)=12.5470<0g(8)=-12.5470<0, g(9)=96.0769>0g(9)=96.0769>0. So roots lie in (1,1.5)(1,1.5) and (8,9)(8,9); bisecting to machine precision gives t=1.06167t=1.06167 and t=8.14390t=8.14390.

  4. Get the tiny root from the constant term. Near t=0t=0 the cubic and quadratic terms are negligible, so 13.5803t+0.0010159097013.5803t+0.0010159097\approx0 gives t7.480×105t\approx-7.480\times10^{-5}, refined by Newton to t=7.480165×105t=-7.480165\times10^{-5}. Dividing all three back by 10001000:

    x=7.480165×108,0.00106167,0.00814390x=-7.480165\times10^{-8},\quad 0.00106167,\quad 0.00814390

  5. Check with Vieta's formulas, computed not assumed. Sum of roots should be 0.01446/1.5708=0.00920550040.01446/1.5708=0.0092055004; the three roots add to 0.00920550040.0092055004 ✓. Product should be 1.0159097×1012/1.5708=6.467467×1013-1.0159097\times10^{-12}/1.5708=-6.467467\times10^{-13}; the roots multiply to 6.467467×1013-6.467467\times10^{-13} ✓. A widely circulated answer of 0.001004550.00100455 and 0.008201340.00820134 fails this test — those values leave residuals near 10810^{-8} instead of 102310^{-23}.

Answer

x7.480165×108,x0.00106167,x0.00814390x\approx-7.480165\times10^{-8},\qquad x\approx0.00106167,\qquad x\approx0.00814390

Need to solve a different problem like this? Open the solver →