Exercise: the secant by hand

The secant method applied to cos²x−x=0 from x0=0, x1=1: five iterations with explicit divided differences and superlinear convergence on display.

Solution

ExampleSecant with x₀=0, x₁=1

Approximate the root of f(x)=cos2xxf(x)=\cos^2 x-x with the secant method starting from x0=0x_0=0 and x1=1x_1=1.

  1. Initial values: f(0)=1f(0)=1 and f(1)=0.7081f(1)=-0.7081. The first divided difference is f[x1,x0]=f(1)f(0)10=1.7081f[x_1,x_0]=\frac{f(1)-f(0)}{1-0}=-1.7081, and:

    x2=x1f(x1)f[x1,x0]=10.70811.7081=0.585455x_2=x_1-\frac{f(x_1)}{f[x_1,x_0]}=1-\frac{-0.7081}{-1.7081}=0.585455
  2. With f(x2)=0.10924f(x_2)=0.10924: f[x2,x1]=0.10924(0.7081)0.5854551=1.9721f[x_2,x_1]=\frac{0.10924-(-0.7081)}{0.585455-1}=-1.9721, hence x3=0.5854550.109241.9721=0.640845x_3=0.585455-\frac{0.10924}{-1.9721}=0.640845.

  3. Two more iterations follow the same pattern: x4=0.641722x_4=0.641722 (residual 1.61051.6\cdot 10^{-5}) and x5=0.6417144x_5=0.6417144 (residual 2.01092.0\cdot 10^{-9}).

In four useful iterations the residual falls from 10110^{-1} to 10910^{-9} without evaluating any derivative. The cadence of the exponents (1,3,5,9-1,-3,-5,-9) reflects the superlinear order p1.618p\approx 1.618: slower than Newton, much faster than bisection.