CHAPTER 03.05: SECANT METHOD: Derivation of Secant Method: Approach 1 of 2   In this segment, we're going to talk about the secant method, we're going to derive the secant method of finding roots of nonlinear equations.  So we're going to look at the derivation of how secant method is used to solve a nonlinear equation of the form f of x equal to 0.  So if you have an equation where the left-hand side is f of x, so we're going to, let's suppose if we plot f of x, the left-hand side of the equation, which is the function, and we plot it as a function of x, and we find out where does it become 0, that becomes the root of the equation.  So that's what we want to look for, we want to see that where does f of x become 0, and that's what we're going to derive by using this numerical method called the secant method.  Now, the approach which we're going to take in order to derive it is based on Newton-Raphson method. Newton-Raphson method gives you an iterative equation of finding . . . or iterative formula to find out the root of the equation f of x equal to 0, and it looks like this. So this is the iterative equation which you have to write, or which you have to use, to find out the root of the equation f of x equal to 0. So basically this recursive relationship involves that you choose some initial guess of xi and you get x-sub-i-plus-1, then you plug it back in here, you get x-sub-i-plus-2, and you continue this process until you find out that your roots are within a pre-specified tolerance.  Now, you can very well see that in order to be able to use this recursive relationship, you've got to know what the derivative of the function f is. So that is required, as you see in the denominator there, so you have to calculate that symbolically to be able to do that.  So that's one of the drawbacks of the Newton-Raphson method, that you have to calculate the derivative of the function f symbolically to be able to use the Newton-Raphson method.  So, one of the ways to get around it is by using an approximation for the derivative of the function, and I can approximate it as the value of the function at xi minus the value of the function at x-sub-i-minus-1, divided by xi minus x-sub-i-minus-1, like this.  Where does this come from?  This is basically your . . . is basically your divided difference polynomial approximation of the derivative of the function, and you're using backward divided difference. So, if this formula looks familiar, it is, because it the backward divided difference formula to approximate the first derivative of a function.  So what you are finding out is that, by taking this approximation, you are saying that, hey, I don't have to find the f prime, or the derivative of the function f, no longer do I have to find it exactly, I can use an approximation instead.  Now, the only thing which you are introducing which is, in addition to what we had in Newton-Raphson method, is that you're introducing another unknown here, which is x-sub-i-minus-1.  So what that means is that you have to make two guesses now, not only will you have to guess what, or make an estimate, or have an initial guess for xi, but also an initial guess for x-sub-i-minus-1, so you will need two initial guesses to start the process, and then get a new guess.  So, if I look at . . . if I substitute this formula back into my Newton-Raphson method formula, I'll get something like this, xi minus f of xi divided by f of xi minus f of x-sub-i-minus-1, divided by xi minus x-sub-i-minus-1. So I'm going to simplify it a little bit by taking this to the numerator, and this is what I'm going to get, I'm going to get x-sub-i-plus-1 is equal to xi minus the value of the function at xi times xi minus x-sub-i-minus-1, divided by the value of the function at xi minus the value of the function at x-sub-i-minus-1. And that's what the secant method is, and this is the secant method formula, so secant method formula for f of x equal to 0.  Now, what you are seeing here is that now you have to have two initial guesses, because you have xi here, x-sub-i-minus-1, so you'll have to have two initial guesses to begin with.  So once you have chosen x-sub-i-minus-1 and xi, you'll be able to calculate this right-hand side and get x-sub-i-plus-1, then you're going to use xi and x-sub-i-plus-1 to get x-sub-i-plus-2, so, again, you will continue this process until you find out that . . . that your root has been found within a pre-specified tolerance, and that's when you will stop the algorithm.  But, again, you've got to understand that you need two initial guesses.  Again, although you need two initial guesses, it does not mean that this is a . . . this is a bracketing method, this is still an open method, so secant method is still an open method, because the two initial guesses which you are going to use, they don't necessarily have to bracket the root.  So, although you have two initial guesses, but they don't necessarily have to bracket the root, so it still falls under the category of the open method, just like the Newton-Raphson method.  And that's the end of this segment.