[Math] How does the calculator calculate the roots for a cubic polynomial

calculatorcalculuscubicsquadraticsroots

For example, many calculators come equipped with the quadratic formula, and so you can give them $A,B,C$ coefficients, and they will show you out the solution using the formula
$$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$

My calculator however finds $x$ when we have $x^3$ too, and this time it asks for $A,B,C,D$.

I was wondering how exactly it did this? Is there a cubic power "formula"? My calculator even calculates irrational roots so I'm not sure how exactly it can do this without a formula.

Best Answer

There are formulas for the cubic and quartic. However it is impossible to find a solution to every quintic function. This took many years to figure out.

I would strongly recommend understanding how the bisection method works for functions. This provides a "numerical solution" instead of a formula which provides a "analytic solution".

There are may numerical techniques that can approximate values that can not be solved directly. Even quintic equations which sometimes don't have analytic solutions, can be solved with numerical solutions.

Edit:

Here is an example of bisection method.This quintic is not solvable: $f(x) = x^5 - x - 1$. But notice $f(1) = - 1$ and $f(2) = 29$ are opposite signs.

bottom <- 1
top <- 2
middle <- (top + bottom) / 2
while top - bottom > 0.0000001 do
   if f(middle) > 0 then
       top <- middle
   else
       bottom <- middle
   end_if
   middle <- (top + bottom) / 2
end_while

Running through the algorithm by hand you will notice that top - bottom is getting smaller and smaller but top and bottom are of opposite signs the whole time and surround a root.