Complex roots of a 4th degree polynomial

The 4th degree polynomial is the highest degree polynomial of which the root can be calculated analytically and it’s quite a demanding task to be done :-) .

But even more so it’s a cool algorithm.

The polynomial must have the form

Polynomial

The approach is now to divide this polynomial by the 2th degree polynomial (x2 + px + q). This division yields another 2th degree polynomial and some leftover like

Polynomial

or with

Polynomial

PolynomialPolynomial


and the leftover r(x) is

PolynomialPolynomial

Now the idea is: If this leftover becomes 0, there are only the 2th degree polynomials

PolynomialPolynomial

and the solution is the root of these 2 polynomials. Which is an easy task to be found.


To get

Polynomial

means

Polynomial

and

Polynomial


Both must be 0.

To solve that. From the upper equation

Polynomial


We get:

Polynomial


The lower equation

Polynomial


a bit reformed

Polynomial


And the equation for q from above inserted:

PolynomialPolynomialPolynomial

(The denominator can be neglected)


To simplify this formula is a hell of a calculation :-)

Polynomial
Polynomial


and

Polynomial
Polynomial


and this multiplied by (2p – a)

PolynomialPolynomial
Polynomial
Polynomial

And all put together the resulting equation:

PolynomialPolynomial
Polynomial


Now we have a 6th degree polynomial. Even worse than the origin polynomial :-)

But it can be reduced to a 3th degree polynomial by a little substitution:


If we substitute

Polynomial


and

Polynomial
Polynomial


The 6th degree polynomial becomes:

Polynomial


And that can be solved by the algorithm of Cerolamo Cardano.

But we are not at the end with this. Now we have u and first have to go back to p.

As we substituted

Polynomial


We have the quadratic equation

Polynomial

What corresponds to the equation in the article about the Quadratic equation

Polynomial

and has the solution:

Polynomial

A parameter comparison shows:

Polynomial

And with this p we can calculate q with the formulation from further above:

Polynomial

And the parameters of the first polynomial of

Polynomial

Are found

The second polynomial is given by

Polynomial

Are found

And with this the roots of both polynomials can be calculated by:

Polynomial

For the first

and

Polynomial

for the second one.

All 4 solutions can be complex if the part inside the square root is negative.


But there remains a special case. As there is a division in the expression



Polynomial

There is the question: What happens if 2p - a = 0? That makes things even a little bit easier.

There are still two expressions that should become 0:


Polynomial


But if a = 2p, the upper expression becomes:



Polynomial


And as a = 2p we replace p = a/2



Polynomial


This is the indication that there is the special case a = 2p.


In the second expression

Polynomial



we do the same replacement p = a/2

Polynomial


Or a bit nicer arranged:

Polynomial


If the part inside the brackets is multiplied by a/a we get

Polynomial


and so

Polynomial


This quadratic equation can be solved with:

Polynomial


And p is already defined in this special case:

Polynomial


Now inside this special case there is another special case: What happens if a = 0?

With the condition

Polynomial



It’s clear that if a = 0 then c = 0 as well. That means the origin 4th degree polynomial becomes:

Polynomial


A quadratic equation of x2 and its solution is

Polynomial


There are 2 solutions for x2 and the searched roots are the square roots of them. If b2 – 4d is negative, x2 will be complex and the square root of x2 has 2 solutions. What means that there are again 2 solutions for each square root and booth can be real or complex too.

To calculate the square root of a complex number we first have to transform the complex number into its polar form with its length

Polynomial


and it has an angle φ given by real and imag part:

Polynomial


and if imag < 0

Polynomial


The square root of x2 is now the square root of the length:

Polynomial


And the angle

Polynomial


There are 2 solutions (see Complex numbers)


The demo project consists of one main window that shows all computed parameters if they are available.

Polynomial



C# Demo Project Complex roots of a 4th degree polynomial
  • FourthDegPoly.zip