Polynomial Examples

Thomas J. Kennedy

Contents:

Let us examine the results of each solver for $f(x)=x^2 - 1$ with three different input domains.

1 Example 1 - [-2, 2]

$f(x)=x^2 - 1$ where $-2\leq x\leq 2$

1.1 Bisection

20 Steps

Solution

$x=\frac{131071}{131072}=0.999992$

$f(x)=-0.000015$

1.2 Regula Falsi (False Position)

1 Step

Method Fails

$x_n=\frac{-2-2}{3-3}*3$ Division by Zero

1.3 Secant

1 Step

Method Fails

$x_n=\frac{2- -2}{3 - 3} * 3$ Division by Zero

1.4 Newton

6 Steps

Solution

$x=\frac{-21523361}{21523360}=-1.000000$

$f(x)=0.000000$


2 Example 2 - [-100, 100]

$f(x)=x^2 - 1$ where $-100\leq x\leq 100$

2.1 Bisection

26 Steps

Solution

$x=\frac{4194325}{4194304}=1.000005$

$f(x)=0.000010$

2.2 Regula Falsi (False Position)

1 Step

Method Fails

$x_n=\frac{-100-100}{9999-9999}*9999$ Division by Zero

2.3 Secant

1 Step

Method Fails

$x_n=\frac{100–100}{9999-9999}*9999$ Division by Zero

2.4 Newton

11 Steps

Solution

$x=-1.000000$

$f(x)=0.000000$


3 Example 3 - [-2, 0.333…]

$f(x)=x^2 - 1$ where $-2\leq x\leq \frac{1}{3}$

3.1 Bisection

1 Step

3.1.1 Method Failed

$f(b_0) < 0$ - Invariant violated!

3.2 Regula Falsi (False Position)

100 Steps

Solution

$x=-1.000000$

$f(x)=-0.000000$

3.3 Secant

10 Steps

Solution

$x=1.000000$

$f(x)=-0.000000$

3.4 Newton

7 Steps

Solution

$x=-1.000005$

$f(x)=0.000011$