Write a function newton.m that is the fixed point iteration for Newton’s method where f.m and
df.m contain the functions f (x) and f 0 (x) respectively. (Just program the derivative you do
not have to use Matlab to find the derivative.) Solve the following using Newton’s method:
1
x3 − 2x = 56, 4x − 28 = 100 sin(x) =
2
Note that Newton’s method is generally seen as “superior” to other methods because Newton’s
method converges quadratically, whereas the other methods converge linearly.
The experimental rate of convergence for an iterative method may be found by finding
ln(|pn+1 − p|)
α≈ .
ln(|pn − p|)
NOTE: In Matlab, log(x) is the natural logarithm, and exp(x) is the natural exponential.
Find the experimental rate of convergence for each example above, using 1-4 iterations only.
For each example, produce a table that looks like the following table:
n xn en rn
1 0.735759 4.261170e-1 2.67
2 0.694042 8.951194e-4 2.22
3 0.693148 4.004998e-7 2.10
4 0.693147 8.015810e-14 2.05