# How do I find the real zeros of a function?

Feb 19, 2016

It depends...

#### Explanation:

Here are some cases...

Polynomial with coefficients with zero sum

If the sum of the coefficients of a polynomial is zero then $1$ is a zero. If the sum of the coefficients with signs inverted on the terms of odd degree is zero then $- 1$ is a zero.

Any polynomial with rational roots

Any rational zeros of a polynomial with integer coefficients of the form ${a}_{n} {x}^{n} + {a}_{n - 1} {x}^{n - 1} + \ldots + {a}_{0}$ are expressible in the form $\frac{p}{q}$ where $p , q$ are integers, $p$ a divisor of ${a}_{0}$ and $q$ a divisor of ${a}_{n}$.

Polynomials with degree <= 4

$a x + b = 0 \implies x = - \frac{b}{a}$

$a {x}^{2} + b x + c = 0 \implies x = \frac{- b \pm \sqrt{{b}^{2} - 4 a c}}{2 a}$

There are formulas for the general solution to a cubic, but depending on what form you want the solution in and whether the cubic has $1$ or $3$ Real roots, you may find some methods preferable to others.

In the case of one Real root and two Complex ones, my preferred method is Cardano's method. The symmetry of this method gives neater result formulations than Vieta's substitution.

In the case of three Real roots, it may be preferable to use the trigonometric substitution that squeezes a cubic into the identity $\cos 3 \theta = 4 {\cos}^{3} \theta - 3 \cos \theta$, thereby finding zeros in terms of $\cos$ and $\arccos$.

There are general formulas for the solution of quartic equations, but it's generally easier to work with the individual cases.

In the worst cases, you can transform $a {x}^{4} + b {x}^{3} + c {x}^{2} + \mathrm{dx} + e$ into a monic quartic by dividing by $a$, get into the form ${t}^{4} + p {t}^{2} + q t + r$ using the substitution $t = x + \frac{b}{4 a}$, then look at factorisations of the form:

${t}^{4} + p {t}^{2} + q t + r = \left({t}^{2} + A t + B\right) \left({t}^{2} - A t + C\right)$

multiplying out and equating coefficients to get 3 simultaneous equations in $A$, $B$ and $C$. Then use ${\left(B + C\right)}^{2} = {\left(C - B\right)}^{2} + 4 B C$ to derive a cubic equation in ${A}^{2}$. By now you hopefully know how to solve cubics, so you can find $A$, hence $B$ and $C$, etc.

Feb 20, 2016

If algebraic solutions are not usable, try Newton's method or similar to find numeric approximations.

#### Explanation:

Quintics and other more complicated functions

If $f \left(x\right)$ is a well behaved continuous, differentiable function - e.g. a polynomial, then you can find its zeros using Newton's method.

Starting with an approximation ${a}_{0}$, iterate using the formula:

${a}_{i + 1} = {a}_{i} - f \frac{{a}_{i}}{f ' \left({a}_{i}\right)}$

For example, if $f \left(x\right) = {x}^{5} + x + 3$, then $f ' \left(x\right) = 5 {x}^{4} + 1$ and you would iterate using the formula:

${a}_{i + 1} = {a}_{i} - \frac{{a}_{i}^{5} + {a}_{i} + 3}{5 {a}_{i}^{4} + 1}$

Putting this into a spreadsheet with ${a}_{0} = - 1$, I got the values:

${a}_{0} = - 1$

${a}_{1} = - 1.166666666666667$

${a}_{2} = - 1.134701651504899$

${a}_{3} = - 1.133002126375077$

${a}_{4} = - 1.132997565917805$

${a}_{5} = - 1.132997565885065$

${a}_{6} = - 1.132997565885065$

If $f \left(x\right)$ has several Real zeros, then you may find them by choosing different values of ${a}_{0}$.

Newton's method can also be used to find Complex zeros in a similar way, but you may prefer to use methods like Durand-Kerner to find all zeros at once.