Let \(f(x)\) be a continuous function. The secant method is a variant of Newton’s method that avoids the use of the derivative of \(f(x)\) — which can be very helpful when dealing with the derivative is not easy. It avoids the use of the derivative by approximating \(f'(x)\) by \(\frac{f(x+h)-f(x)}{h}\) for some \(h\text{.}\) That is, it approximates the tangent line to \(f\) at \(x\) by a secant line for \(f\) that passes through \(x\text{.}\) To limit the number of evaluations of \(f(x)\) required, it uses \(x=x_{n-1}\) and \(x+h=x_n\text{.}\) Here is how it works.
Suppose that we have already found \(x_n\text{.}\) Then we denote by \(y=F(x)\) the equation of the (secant) line that passes through \(\big(x_{n-1}, f(x_{n-1})\big)\) and \(\big(x_n,f(x_n)\big)\) and we choose \(x_{n+1}\) to be the value of \(x\) where \(F(x)=0\text{.}\)
The equation of the secant line is
\begin{equation*}
y = F(x) = f(x_{n-1}) + \frac{f(x_n)-f(x_{n-1})}{x_n-x_{n-1}}(x-x_{n-1})
\end{equation*}
Here are the results, starting Newton’s method with \(x_1=4\) and starting the secant method with \(x_0=4\text{,}\)\(x_1=3\text{.}\) (So we are giving the secant method a bit of a head start.)
For comparison purposes, the square root of \(2\text{,}\) to 15 decimal places, is \(1.414213562373095\text{.}\) So the secant method \(x_7\) is accurate to 7 decimal places and the Newton’s method \(x_7\) is accurate to at least 15 decimal places.
The advantage that the secant method has over Newton’s method is that it does not use the derivative of \(f\text{.}\) This can be a substantial advantage, for example when evaluation of the derivative is computationally difficult or expensive. On the other hand, the above example suggests that the secant method is not as fast as Newton’s method. The following subsection shows that this is indeed the case.