Roots of Polynomial Equation.

(Uses Maple V): solve, roots
Both functions solve & roots can be used to find the roots of a polynomial equation. roots is good for solving polynomial with one variable only, while solve not only it can find all the roots, also it can be used to find roots of system of linear or nonlinear algebraic equations. Topic on "Solving System of Variables" demonstrate how solve tackle engineering problems.

Solve and roots do not produce the same outcomes. You will observe that solve usually do better than roots. Lets begin by considering,

Quadratic Equation:

Almost everyone know the Quadratic Formula. It allows one to calculate the two roots given coefficients: a, b & c of a Quadratic Equation:

a*x2 + b*x + c = 0

Maple V solve function can create the formula,

> solve( {a*x^2 + b*x + c = 0}, {x} );

roots function can not create the formula. When attempted, it will simply generate an error message.


Cubic Equation::

The cubic roots formula of a cubic equations likewise is easily handled by solve,

> solve( {a*w^3 + b*w^2 + c*w + d = 0}, {w} );

Again, roots, can not produce the formula.


Testing Quadratic

> solve( {x^2 + x - 2 = 0}, {x} );

> roots(x^2 + x -2 );

This mean x=1 & x=-2 each have multiplicity of 1.

Another test,

> solve( { x^2 + 6*x + 25 }, {x} );

> roots(x^2 + 6*x + 25);

No real roots. Next try for complex roots by attribute "I".

> roots(x^2 + 6*x + 25, I);

Found a pair of complex conjugate, both of multiplicity 1.

Testing Cubic

>eq3:=x^3 - 7*x - 6 = 0;

> solve( {eq3}, {x} );

To check, let us back substitute a root,

> subs(x=-2, eq3);

Using roots,

> roots(eq3, I);

Each roots has multiplicity of 1.

The next cubic must have roots: 2, -2 + j5 & -2 - j5.

> solve( { x^3 + 2*x^2 + 21*x - 58 }, { x } );

> roots(x^3 + 2*x^2 + 21*x - 58, I);


Quartic Roots Formula:

> solve( { a*p^4 + b*p^3 + c*p^2 + d*p + e = 0 }, { p } );

RootOf is the roots placeholder. To see all the complex numerical values of the roots we must invoke the allvalues("); commands immediately after. allvalues do not work for equation with symbolic coefficients. So lets try a different quartic.

> restart;
> solve({x^4+x^2+x+1=0},{x});
The result,

Now lets invoke command allvalues,

> allvalues(");
The four numerical roots are,

Again no formula from roots.

Testing Quartic

> eq4:= x^4 + x^2 + 2;

> solve({eq4}, {x});

> j:=sqrt(-1);

> subs(x=sqrt(-2+2*j*sqrt(7))/2, eq4);

> simplify(");

Lets try roots,

> roots(eq4, I);

Real or complex roots can not be found by roots.

Now test the roots displayed by the allvalues command,

> restart;
> eq4x:=x^4+x^2+x+1:
> solve({eq4x=0},{x});
> allvalues(");
Result,

Test two of the roots using substitution for validity,

> subs(x=-.5474237946-.5856519797*I, eq4x);

> subs(x=.5474237946-1.120873490*I, eq4x);

Pretty good!


Numerical Roots of Higher Degree Polynomials:

> solve( {x^6 - 1}, {x} );

Now using roots,

> roots(x^6-1, I);

This is a disappointing results. It only found two roots out of possible six.