CHAPTER 03.04: NEWTON-RAPHSON METHOD: Example for Newton-Raphson Method
In this segment, we're going to take an example for the Newton- Raphson method of finding the roots of a nonlinear equation. So we'll take an example of that.
Again, let's suppose somebody tells me to calculate the root of this equation, x cubed equal to 20, and says go ahead and do Newton-Raphson method, and choose an initial guess of 3.0 for that, and maybe conduct three iterations. Again, the first thing which I have to understand is that the Newton-Raphson method is written for the case of when is the value of the function 0? So that is the form of the root of the . . . form of the equation which you have to write, the function equal to 0. Since this is not in that particular form, because it's x cubed equal to 20, I'll have to rewrite it like this, x cubed minus 20 equal to 0, and that's going to give me my function f of x, function of x is equal to x cubed minus 20 equal to 0. So let's go ahead and conduct these three iterations by the Newton-Raphson method.
Now, if you look at the general formula for the Newton-Raphson method, it is x-sub-i-plus-1 is equal to xi minus the value of the function at the guess, divided by the derivative of the function at that guess. So if I choose i equal to 0, I'll get x1 is equal to x0 minus the value of the function at x0 divided by f prime of x0. But what you are seeing here is that I need the derivative of the function. So I did not show you how to calculate that, so what I'm going to do is I'm going to step back a little bit by saying that, hey, the function which I have is x cubed minus 20, and the derivative of this function is 3 x squared, okay? So what I will get is that x1 will be equal to x0 minus the value of the function at x0, which is x0 cubed minus 20, divided by 3 x0 squared, that's what I'm going to get. And since it has been given to me that the value of x0 is 3.0, so I'll just substitute the value of 3 in there, and this value here turns out to be 2.741 . . . 2.741. So I started with an initial guess of 3, and what I'm getting is the value of x1, which is my next estimate of the root of the equation to be 2.741. Now, in this case, since I have a previous estimate, which was 3, which I chose, or which was given to me, and this is my new estimate, 2.741, I can in fact calculate my absolute relative approximate error. So I'm going to calculate my absolute relative approximate error to be my present approximation, which I just calculated as 2.741, minus the previous approximation, which was 3, which was my initial guess, divided by 2.741, which is my current approximation, times 100, and that number turns out to be 9.45 percent. So you're finding out at the end of the first iteration, the absolute relative approximate error is 9.45 percent.
Let's go ahead and see what we're going to get for i equal to 2, which is my . . . i equal to 1, which is my next iteration, so that's the next iteration, i equal to 0 corresponded to the first iteration, so in this case I'll get x2 is equal to x1 minus the value of the function at x1 divided by f prime of x1. So that's equal to x1 minus the value of the function at x1 is x1 cubed minus 27, divided by 3 x1 squared, because that's the . . . x1 cubed minus 20, because that's my function, the left-hand side of the equation, x cubed minus 20, and that's the derivative of this function, which is 3 x squared, so I'll substitute the value of x1 in here, x1 is 2.741 minus 2.741 cubed minus 20, divided by 3 times 2.741 squared. And the value which I get is 2.715 here for the estimate of the root of the equation. So I started with 2.741, and I'm getting 2.715 as the next estimate of my guess there. I can calculate my absolute relative approximate error, which will be the present approximation, which is 2.715, minus the previous approximation, which is 2.741, divided by the present approximation, 2.715, I'm going to multiply by 100 to get the value in terms of percentages, and I get 0.96 percent. So right here you're finding out that your relative approximate error went from 9.45 percent for the previous iteration to 0.96 percent for the next iteration, so you can see that when Newton-Raphson method converges, it does converge fast. And at this stage, because the relative approximate error is 0.96 percent, I can claim that one, at least one significant digit is correct in my answer, because this number is less than 5 percent, it's not less than 0.5. So since this is less than or equal to 5 percent, I can claim that this number 2 is the . . . is the correct significant digit in my answer, because less than 5 percent.
So let's conduct one more iteration, so in that case I'll have to choose i equal to 2. So when I choose i equal to 2, I'll get x3 is equal to x2 minus the value of the function at x2 divided by f prime of x2. Again, I'm going to substitute what the function is, the function is x cubed minus 20, so it's x2 cubed . . . x2 cubed minus 20, and the derivative of the function is 3 x squared, so it will be 3 x2 squared. So in this case, I'm going to just write it down here, your x2, which we just found out, is 2.715, minus 2.715 cubed minus 20, divided by 3 times 2.715 squared, so that's what you get for substituting it there, and the value which you're going to get is 2.714. So you are going from an approximation of 2.715 to 2.714 as your new guess. So if I calculate my relative approximate error, relative approximate error will be the current approximation, which is 2.714, minus the previous approximation, which is 2.715, times 100, and this turns out to be approximately 0.009 percent. So what you are finding out is that if you look at the absolute relative approximate error, you went from 9.45 percent, to 0.96 percent, all the way up to 0.009 percent at the end of the third iteration. First iteration, your . . . this was your absolute relative approximate error, at the end of the second iteration it almost became one tenth of this, and then the third iteration is almost equal to one one-hundredth of what it was before. So this Newton-Raphson method is converging very . . . very fast, and this one is less than 0.05 percent, less than or equal to 0.05 percent, so it is less than 5 percent, it is less than 0.5 percent, it is less than 0.05 percent, so that means at least three significant digits are correct in my answer which I just found out, so when you look at 2.714, which is your value of x3, and you're finding out that epsilon-a, which is 0.009 percent, is less than 0.0 . . . less than or equal to 0.05 percent. That means that you can have three significant digits at least correct in your solution, because you need one . . . for one significant to be at least correct you need 5 percent, for two you need 0.5 percent, and for three you need 0.05 percent, so you can trust your 2, you can trust your 7, you can trust your 1. So you get three significant digits which are at least correct in the root of your equation x cubed minus 20 equal to 0. And that's the end of this segment. |