# How do you find all the real and complex roots of f (x) = x^5 – x^4 + 3x^3 + 9x^2 – x + 5?

May 31, 2016

Use the Durand-Kerner method to find numerical approximations for the zeros.

#### Explanation:

Given:

$f \left(x\right) = {x}^{5} - {x}^{4} + 3 {x}^{3} + 9 {x}^{2} - x + 5$

By the rational root theorem, any rational zeros of $f \left(x\right)$ are expressible in the form $\frac{p}{q}$ for integers $p , q$ with $p$ a divisor of the constant term $5$ and $q$ a divisor of the coefficient $1$ of the leading term.

So the only possible rational zeros are:

$\pm 1$, $\pm 5$

None of these work, so the zeros of $f \left(x\right)$ are irrational and/or Complex.

To find numeric approximations for the zeros, you can use the Durand-Kerner method:

Suppose the $5$ zeros are: $p , q , r , s , t$.

Choose initial approximations for these zeros as follows:

${p}_{0} = {\left(0.4 + 0.9 i\right)}^{0}$

${q}_{0} = {\left(0.4 + 0.9 i\right)}^{1}$

${r}_{0} = {\left(0.4 + 0.9 i\right)}^{2}$

${s}_{0} = {\left(0.4 + 0.9 i\right)}^{3}$

${t}_{0} = {\left(0.4 + 0.9 i\right)}^{4}$

Then iterate using the formulas:

${p}_{i + 1} = {p}_{i} - \frac{f \left({p}_{i}\right)}{\left({p}_{i} - {q}_{i}\right) \left({p}_{i} - {r}_{i}\right) \left({p}_{i} - {s}_{i}\right) \left({p}_{i} - {t}_{i}\right)}$

${q}_{i + 1} = {q}_{i} - \frac{f \left({q}_{i}\right)}{\left({q}_{i} - {p}_{i + 1}\right) \left({q}_{i} - {r}_{i}\right) \left({q}_{i} - {s}_{i}\right) \left({q}_{i} - {t}_{i}\right)}$

${r}_{i + 1} = {r}_{i} - \frac{f \left({r}_{i}\right)}{\left({r}_{i} - {p}_{i + 1}\right) \left({r}_{i} - {q}_{i + 1}\right) \left({r}_{i} - {s}_{i}\right) \left({r}_{i} - {t}_{i}\right)}$

${s}_{i + 1} = {s}_{i} - \frac{f \left({s}_{i}\right)}{\left({s}_{i} - {p}_{i + 1}\right) \left({s}_{i} - {q}_{i + 1}\right) \left({s}_{i} - {r}_{i + 1}\right) \left({s}_{i} - {t}_{i}\right)}$

t_(i+1) = t_i-(f(t_i))/((t_i-p_(i+1))(t_i-q_(i+1))(t_i-r_(i+1))(t_i-s_(i+1))

Keep iterating until the values are stable to the desired accuracy.

The zeros you will find will be approximately:

$- 1.6073$

$0.109713 + 0.702004 i$

$0.109713 - 0.702004 i$

$1.19394 + 2.17633 i$

$1.19394 - 2.17633 i$

Here's a C++ program which does the calculation:

This is what its (slightly primitive) output looks like: