Algorithm Search⌘K

Proofs: Secant method

These are the human proofs of Secant method, at full length.

The secant method ends, converges near a simple root, and has order (1 + 5^(1/2))/2 full

This proof shows: correctness, termination, local-convergence, order.

We write xk−1,xkx_{k-1}, x_k for the values of x0,x1x_0, x_1 at the start of pass kk of the loop of lines L3 to L10, so the starting points are x0,x1x_0, x_1 and pass kk computes xk+1x_{k+1}. Let ek=xk−x∗e_k = x_k - x^*, fk=f(xk)f_k = f(x_k), and let f[a,b]f[a, b] and f[a,b,c]f[a, b, c] be the first and second divided differences.

Claim 1 (termination and flags). SECANT returns after at most kmax⁡k_{\max} passes and kmax⁡+2k_{\max} + 2 evaluations of ff. A result with the flag "root" is an exact zero of ff; a result with the flag "converged" passed the test of line L8.

Proof. Lines L1 and L2 make two evaluations, each pass makes at most one (line L9), and the loop of line L3 runs at most kmax⁡k_{\max} times. Lines L1, L2 and L9 return only when the value is exactly 00, and line L8 only after its test. The division in line L5 is defined because line L4 has checked f1≠f0f_1 \ne f_0. □\square

Lemma (the error identity). Let f∈C2f \in C^2 on an interval II that holds xk−1x_{k-1}, xkx_k and x∗x^*, with xk−1≠xkx_{k-1} \ne x_k and f[xk−1,xk]≠0f[x_{k-1}, x_k] \ne 0. Then

ek+1=f[xk−1,xk,x∗]f[xk−1,xk] ekek−1,e_{k+1} = \frac{f[x_{k-1}, x_k, x^*]}{f[x_{k-1}, x_k]}\, e_k e_{k-1},

and there are ξk,ηk∈I\xi_k, \eta_k \in I with f[xk−1,xk,x∗]=12f′′(ξk)f[x_{k-1}, x_k, x^*] = \tfrac12 f''(\xi_k) and f[xk−1,xk]=f′(ηk)f[x_{k-1}, x_k] = f'(\eta_k).

Proof. Line L5 gives xk+1=xk−fk/f[xk−1,xk]x_{k+1} = x_k - f_k / f[x_{k-1}, x_k]. Since f(x∗)=0f(x^*) = 0, fk=fk−f(x∗)=f[xk,x∗] ekf_k = f_k - f(x^*) = f[x_k, x^*]\, e_k (if xk=x∗x_k = x^* both sides are 00, with f[x∗,x∗]=f′(x∗)f[x^*, x^*] = f'(x^*)). So

ek+1=ek−f[xk,x∗] ekf[xk−1,xk]=ek f[xk−1,xk]−f[xk,x∗]f[xk−1,xk].e_{k+1} = e_k - \frac{f[x_k, x^*]\, e_k}{f[x_{k-1}, x_k]} = e_k\, \frac{f[x_{k-1}, x_k] - f[x_k, x^*]}{f[x_{k-1}, x_k]}.

By the definition of the second divided difference, f[xk−1,xk]−f[xk,x∗]=(xk−1−x∗) f[xk−1,xk,x∗]=ek−1 f[xk−1,xk,x∗]f[x_{k-1}, x_k] - f[x_k, x^*] = (x_{k-1} - x^*)\, f[x_{k-1}, x_k, x^*] = e_{k-1}\, f[x_{k-1}, x_k, x^*]. This gives the identity. The mean value forms of divided differences give ξk\xi_k and ηk\eta_k in the smallest interval that holds the points, which lies in II. □\square

Claim 2 (local convergence). Let f∈C2f \in C^2 on I=[x∗−r,x∗+r]I = [x^* - r, x^* + r] with f(x∗)=0f(x^*) = 0 and f′≠0f' \ne 0 on II, let M=max⁡I∣f′′∣/(2min⁡I∣f′∣)M = \max_I |f''| / (2 \min_I |f'|), and let x0≠x1x_0 \ne x_1 in II with M∣e0∣≤1/2M |e_0| \le 1/2 and M∣e1∣≤1/2M |e_1| \le 1/2. Then in exact arithmetic, with kmax⁡=∞k_{\max} = \infty and a zero tolerance, every xkx_k lies in II, ∣ek+1∣≤M∣ek∣∣ek−1∣≤12∣ek∣|e_{k+1}| \le M |e_k| |e_{k-1}| \le \tfrac12 |e_k|, and xk→x∗x_k \to x^*.

Proof. By induction on k≥1k \ge 1 we show: xk−1,xk∈Ix_{k-1}, x_k \in I, M∣ek−1∣≤1/2M |e_{k-1}| \le 1/2 and M∣ek∣≤1/2M |e_k| \le 1/2. This holds for k=1k = 1. Assume it for kk. If fk=0f_k = 0 the method returns at line L2 or L9 with xk=x∗x_k = x^*, since f′≠0f' \ne 0 on II makes x∗x^* the only zero in II. Otherwise xk≠x∗x_k \ne x^*. The points xk−1x_{k-1} and xkx_k differ: for k=1k = 1 by assumption, and for k≥2k \ge 2 because xk=xk−1+sx_k = x_{k-1} + s with s=0s = 0 only if fk−1=0f_{k-1} = 0, which has already returned. By the mean value theorem f[xk−1,xk]=f′(η)≠0f[x_{k-1}, x_k] = f'(\eta) \ne 0, so fk≠fk−1f_k \ne f_{k-1} and line L4 does not stop. The lemma gives ∣ek+1∣≤M∣ek∣∣ek−1∣≤12∣ek∣≤r|e_{k+1}| \le M |e_k| |e_{k-1}| \le \tfrac12 |e_k| \le r, so xk+1∈Ix_{k+1} \in I and M∣ek+1∣≤12M∣ek∣≤1/2M |e_{k+1}| \le \tfrac12 M |e_k| \le 1/2. This completes the induction. Then ∣ek+1∣≤12∣ek∣|e_{k+1}| \le \tfrac12 |e_k| for all k≥1k \ge 1, so ∣ek∣≤21−k∣e1∣→0|e_k| \le 2^{1-k} |e_1| \to 0. □\square

Claim 3 (order φ\varphi). Under the hypotheses of Claim 2, assume also that f′′(x∗)≠0f''(x^*) \ne 0 and that no eke_k is zero. Let φ=(1+5)/2\varphi = (1 + \sqrt 5)/2 and C=∣f′′(x∗)/(2f′(x∗))∣C = |f''(x^*) / (2 f'(x^*))|. Then

lim⁡k→∞∣ek+1∣∣ek∣φ=C1/φ.\lim_{k \to \infty} \frac{|e_{k+1}|}{|e_k|^{\varphi}} = C^{1/\varphi}.

Proof. Let Mk=∣ek+1∣/(∣ek∣∣ek−1∣)M_k = |e_{k+1}| / (|e_k| |e_{k-1}|). By the lemma Mk=∣f′′(ξk)∣/(2∣f′(ηk)∣)M_k = |f''(\xi_k)| / (2 |f'(\eta_k)|), and since xk−1,xk→x∗x_{k-1}, x_k \to x^*, both ξk\xi_k and ηk\eta_k tend to x∗x^*, so Mk→C>0M_k \to C > 0 by continuity. Let yk=∣ek+1∣/∣ek∣φy_k = |e_{k+1}| / |e_k|^{\varphi}. Since φ2=φ+1\varphi^2 = \varphi + 1, we have (1−φ)(−φ)=φ2−φ=1(1 - \varphi)(-\varphi) = \varphi^2 - \varphi = 1, and so

yk−11−φ=∣ek∣1−φ ∣ek−1∣−φ(1−φ)=∣ek∣1−φ ∣ek−1∣.y_{k-1}^{1 - \varphi} = |e_k|^{1 - \varphi}\, |e_{k-1}|^{-\varphi(1 - \varphi)} = |e_k|^{1 - \varphi}\, |e_{k-1}|.

Hence yk=Mk∣ek∣∣ek−1∣/∣ek∣φ=Mk yk−11−φy_k = M_k |e_k| |e_{k-1}| / |e_k|^{\varphi} = M_k\, y_{k-1}^{1 - \varphi}. Take logarithms, use 1−φ=−1/φ1 - \varphi = -1/\varphi, and set ρ=1/φ≈0.618<1\rho = 1/\varphi \approx 0.618 < 1:

ln⁡yk=ln⁡Mk−ρln⁡yk−1.\ln y_k = \ln M_k - \rho \ln y_{k-1}.

Let L=ln⁡C/(1+ρ)L = \ln C / (1 + \rho), zk=ln⁡yk−Lz_k = \ln y_k - L and ϵk=ln⁡Mk−ln⁡C\epsilon_k = \ln M_k - \ln C. Then zk=ϵk−ρzk−1z_k = \epsilon_k - \rho z_{k-1}, so ∣zk∣≤∣ϵk∣+ρ∣zk−1∣|z_k| \le |\epsilon_k| + \rho |z_{k-1}|, with ϵk→0\epsilon_k \to 0.

The sequence zkz_k tends to 00. Let E=sup⁡k∣ϵk∣<∞E = \sup_k |\epsilon_k| < \infty. By induction ∣zk∣≤E/(1−ρ)+∣z1∣|z_k| \le E/(1 - \rho) + |z_1|, so (zk)(z_k) is bounded. Let λ=lim sup⁡∣zk∣\lambda = \limsup |z_k|. Taking the limit superior in ∣zk∣≤∣ϵk∣+ρ∣zk−1∣|z_k| \le |\epsilon_k| + \rho |z_{k-1}| gives λ≤0+ρλ\lambda \le 0 + \rho \lambda, so λ=0\lambda = 0.

So ln⁡yk→L\ln y_k \to L, and yk→eL=C1/(1+ρ)y_k \to e^L = C^{1/(1 + \rho)}. Since 1+ρ=1+1/φ=(φ+1)/φ=φ2/φ=φ1 + \rho = 1 + 1/\varphi = (\varphi + 1)/\varphi = \varphi^2/\varphi = \varphi, the limit is C1/φC^{1/\varphi}. □\square

Floating point. Claim 1 holds in floating point as stated. Claims 2 and 3 hold in exact arithmetic; in floating point the iterates follow them until the error reaches the limiting accuracy. ■\blacksquare

Back to Secant method