Department of Applied Mathematics at the University of Colorado at Boulder
University of Colorado at Boulder Search A to Z Campus Map University of Colorado at BoulderCU Search Links
Print this page

Solve a Polynomial

1: Solve Polynomial

Three of the four can solve polynomials (at least some, of degree<5) analytically, e.g., exactly.
All four systems can solve (any) polynomials numerically, to machine precision (~14 decimal digits) or better.

Solve x3 + x2 + 2x - 23 = 0

Mathematica:

(analytical): Solve[x^3+x^2+2x-23==0, x]

(numerical): NSolve[x^3+x^2+2x-23==0, x]

(to 50 digits): N[Solve[x^3+x^2+2x-23==0, x],50]

Matlab:

(analytical): solve('x^3+x^2+2*x-23=0')

(numerical): roots([1 1 2 -23])

Maple:

(analytical): solve(, );

(numerical):
fsolve(,,complex);

(to 50 digits):
Digits:=50;
fsolve(,,complex);

IDL: (numerical only)

c = [ -23., 2., 1., 1. ]   ; polynomial's coefficients
soln = fz_roots(c)
print, soln