CHAPTER 03.04: NEWTON-RAPHSON METHOD: Finding Square Root of a Number - Example
Let's go, in this segment, we're going to talk about how to find square root of a number. We're going to look at an example of how do we find the square root of a number by using the Newton- Raphson method formula for finding roots of an equation. So we're going to look at an example here. So the way we derived the Newton-Raphson method formula, which is in another segment is that we start with the equation f of x is equal to x squared minus R, we're trying to find out what the square root of R is by simply solving the equation of x squared minus R equal to 0, and the Newton-Raphson method formula turns out to be . . . the recursive formula turns out to be of this nature, that x-sub-i-plus-1 is equal to one half, xi plus R divided by xi. So what that means is that we have to start with some initial guess here of the value of R which is given to us, and then continue this process here, until we find out that how . . . how acceptable our result for square root of R is.
So let's take an example here, so let's suppose somebody tells me to find square root of 62.41 by using this recursive formula. So let's see that how many iterations does it take for me to find the square root of R within a reasonable amount of accuracy. So what that means is that my x-sub-i-plus-1, in this case, will be one half, xi plus 62.41 divided by xi, and you can clearly see now that this is a recursive formula here, that I put in some starting value of xi, I get a new value of xi, then I put that back in here, and I keep on doing this process until I find out there is some refinement which has taken place, and that refinement should be acceptable to me. So let's go ahead and see that what I'm going to choose for my initial guess, that's the question which arises many a times. So in this case, what I'm going to do is I'm going to keep it simple, I'm going to say, hey, I'm going to choose initial guess to be the number itself. Not a good choice of the square root of a number, but I'm going to say, hey, that's the best I can do, that I'm trying to find the square root of 62.41, I'm going to choose 62.41 as my . . . as my initial value of initial guess of the square root. So what do I get from there? I'll get x1 is equal to x . . . is equal to one half, x0 plus 62.41 divided by x0, and since my initial guess which I chose is the number itself, I'm going to get something like this, and that value here turns out to be 31.705. So that's what I get as my first estimate of the square root of 62.41, by choosing 62.41 itself as my starting value.
So, let's go ahead and see that, let's do one more iteration, let's say i is equal to 2 . . . i is equal to 1, i is equal to 1, I just found out what x1 is, which is 31.705, and I want to find x2, so if I put, so if I put i equal to 1 into the Newton-Raphson method formula which I just derived for the square root of a number, it will be one half, x1 plus 62.41 divided by x1, and what is that? x1 is 31.705 plus 62.41 divided by 31.705, that's what I get there, and this number here turns out to be 16.83. So the first estimate, first guess which I made was 62.41 for my initial guess, then the first iterative value which I got for the square root of the number is 31.705, and the next one which I am getting is 16.83.
So I have conducted some more iterations, and I'm going to just write those down, so I'm going to put i here, I'm going to put what xi is. My initial guess was 62.41, then I obtained 31.705, which we just calculated, and for the second iterative value, I got 16.83, which I calculated. And then, I'm . . . the third iterative value I'm getting 10.27, and that can be your homework, the fourth value I'm getting is 8.173, and that's also your homework, and the fifth value which I get is 7.905, and that's your homework also. So, after five iterations, first iteration I get this, first iterations are already done . . . done for you, and I would like you to do iteration number three, four, and five, and that's what you get, 7.905. In fact, if you take 62.41 and you take the square root of that, that's the exact value. So even when we started with a . . . with not such a good guess of the number itself for the square root of the number, after five iterations or so, you are finding out that you are extremely . . . you're close to the exact value of the square root of that particular number here.
So that's how Newton-Raphson method formula is used to find the square root of a number. And as we have said, the reason why you take such . . . such a plan to find out the square root of a number on many of these super computers is because of the fact that this uses less computation time than having to take a log of this . . . log of the number, and then taking the exponential of that number to be able to find the square root of a number. In fact, the same kind of a Newton-Raphson method formula can be derived for finding cube root of a number, fourth root of a number, and so on and so forth, and those can be made computationally more efficient than the regular ways of finding those roots of . . . the root of a number, or square root of a number, or cube root of a number. And that's the end of this segment.