# secant method

The secant method which is similar to the Newton-Raphson method is used to find the extremum^{} value for a function over an interval for which the defined function has only one extremum. If there is more then one minimum or maximum, then convergence is not guaranteed.

The advantage over the Newton-Raphson method is that the secant method does not require the second derivative so only one function is used, the derivative^{}. However, two initial guesses are needed. The algorithm^{} to find the extremum is to iterate using the following expression

$${x}_{k}={x}_{k}-{f}^{\prime}({x}_{k})\frac{{x}_{k}-{x}_{k-1}}{{f}^{\prime}({x}_{k})-{f}^{\prime}({x}_{k-1})}$$ |

An analytical example is given below for the simple function^{}

$$f(x)={x}^{2}+1$$ |

taking the derivative yields

$${f}^{\prime}(x)=2x$$ |

So for the initial guesses of ${x}_{0}=3$ and ${x}_{1}=5$, ${x}_{2}$, the first iteration evaluates to

$${x}_{2}=5-{f}^{\prime}({x}_{1})\left[\frac{5-3}{{f}^{\prime}({x}_{1})-{f}^{\prime}({x}_{0})}\right]$$ |

The derivatives at these two points are

$${f}^{\prime}({x}_{1})=10$$ |

$${f}^{\prime}({x}_{0})=6$$ |

giving us the value for the first iteration of

${x}_{2}=0$.

To check when we are done iterating, we need one more iteration for comparison, so

$${x}_{3}={x}_{2}-{f}^{\prime}({x}_{2})\left[\frac{0-5}{{f}^{\prime}({x}_{2})-{f}^{\prime}({x}_{1})}\right]$$ |

which is

${x}_{3}=0$

Since ${x}_{3}-{x}_{2}=0$, we are done and our extremum is $0$.

Not every function is so easy to iterate analytically and we must resort to numerical means. The attached file, \PMlinktofilesecantMethod1.msecantMethod1.m, shows how to iterate using matlab on the more complicated function

$$f(x)=x\sqrt{100-{x}^{2}}$$ |

One still must be careful when using the secant method since the above function has a maximum and a minimum on the interval of [-10,10] and you will not get convergence if your initial guesses are -2 and 2. However, on the interval of [0,10], there is only one extremum, so choose guesses of 5 and 6. Then the matlab function converges to the extremum of

$5*\sqrt{2}=7.0711$

which is a maximum as the figure below shows

## 0.1 References

[1] Tragesser, S. ” Optimization”, lecture notes, University of Colorado at Colorado Springs, Spring 2006.

Title | secant method |
---|---|

Canonical name | SecantMethod |

Date of creation | 2013-03-22 15:39:22 |

Last modified on | 2013-03-22 15:39:22 |

Owner | bloftin (6104) |

Last modified by | bloftin (6104) |

Numerical id | 10 |

Author | bloftin (6104) |

Entry type | Algorithm |

Classification | msc 49M15 |

Related topic | MethodsToFindExtremum |