Transcript for:
Newton-Raphson Method Lecture Notes

hi welcome to another video in my series on numerical methods of solving equations now in the previous tutorials I've shown you how we can go about solving this equation x cubed plus 2X minus 2 equals zero knowing that it has a root between 0 and 1 and we looked at the bisection method and the new interpolation now I want to show you how we can solve this equation by using the newton-raphson method and this is a very powerful method very quick but it has one drawback and that is sometimes it doesn't converge to the root but in the examples I give you now okay it does converge to root so what is the newton-raphson method well first of all this is the formula and I'm giving it to you without any proof okay it's a iterative based equation here if we know an approximation for a root let's say we call it x n then we can get the next approximation a better approximation usually xn plus one by this formula that next approximation is given by xn the first approximation minus f of x n all divided by F dash of x n so I'll show you give you an example then how we can find the root for this equation now what we need to do is Define f of x first of all so in the usual way is make sure your equation does equal zero though so if not just rearrange it so it equals zero and then just say let f of x be the left hand side of this equation here which will be X cubed in this case plus 2X minus 2. now to use the newton-raphson formula we need to find F dash of x f Dash is the first differential of f of x with respect to X so therefore F Dash X if we differentiate this with respect to X for X cubed it's going to be 3x squared and for 2x it's going to be plus 2 and the minus 2 just goes to zero so F Dash X then equals 3x squared plus 2. now we know that there's a route between naught and one and we have tested that in the past because if we put naught in here we get minus two and if we put one in here we get one and so there's been a change in sign over this interval so we know that there's a root in that interval so if we take as our first approximation let's just say let X1 some books will use x0 here for the first approximation it's up to you but let X1 be the first approximation and I'm going to take 1 as the value now what we do now is we get x2 a better approximation hopefully when we let N equal 1 here so we get the second approximation so therefore X2 will be equal to according to newton-raphson's formula xn in this case X1 which is going to be one minus F of X1 so we've just got to put one through f of x so we're going to have 1 cubed plus 2 times 1. minus the 2 okay F of 1. then we have to do F dash of one all right so let's just put that in here F dash of 1 is going to be 3 times 1 squared plus the 2. now if you work this out you get your second approximation which comes out to be 0.8 so now that we have X2 we can get a third approximation to the root X3 in other words because if n equals 2 we've got x 3 here X3 will be equal to X2 minus F of X2 all divided by F dash of X2 X2 being 0.8 then we can just write this in as 0.8 minus F of 0.8 so put that in 0.8 cubed plus 2 times 0.8 minus 2 and that's all divided by F dash of X2 F dash of 0.8 so put it into here and we've got three times 0.8 squared plus 2. and if you work this out you'll find that you get 0.77142 and so on so to two decimal places well this is going to be 0.77 but we can't stop here because we've got to make sure that we have no change in this third digit here so we need to carry on this process now I've got this calculator over here because in doing this just setting it out like this it takes obviously quite a while to do but there is a quicker way that you could work through these calculations when you have iterative based type formulas and that way is that we just type in your first approximation into your calculator and I'm assuming that you've got a scientific calculator with an answer button ANS here okay because if you have then as I say you can do this a very quick way and you should be familiar with this way anyway from just basic iterative methods that you should have done earlier but anyway just to recap all you do is you type one into the calculator okay and then just press equals okay so as soon as you press equals this becomes the answer it remembers that ANS represents the value that you've got here in this case one so just clear that that value off by pressing AC so the screen will clear and one is stored in this value here as ANS answer so now you just need to type in this particular formula only we need to replace xn with answer so for this part we just hit the answer key and you should find that you get a and S come up on the screen and then enter negative okay or minus there and you most probably have got a fraction button somewhere on your calculator okay if you've got a faction button that you can use then we need to enter f of x n and in this case it will be the answer cubed plus 2 times the answer minus two so you'd have answer cubed okay plus two times answer or just to answer and then the minus two and then we divide this all by F dash of xn xn remember will now be our answer button so it'll be three times the answer squared plus two so three times answer squared plus two okay so every time you get the answer just keep pressing that and you should have that on your display and then when you press equals is passing your first value for answer which was one through this equation here and you should find when you press C equals you get 0.8 and then if you press equals again you'll find you get the third approximation 0.77142 and so on and if you keep pressing equals you'll get your next value X4 in this case and if you do that it comes out at 0.7709 and so on and if you do it again you'll get X5 and that's 0.7709 and so on again and so this saves a lot of time if you can do this and you can see that we have no change in the third decimal place here so to two decimal places are Roots then X will be 0.77 then to 2 DP two decimal places Okay so it can be very quick to do this assuming though that it does converge to a limit as I said earlier in some cases using this method you'll find that it doesn't converge to a root I'm not explaining why in this tutorial okay but the questions that you generally get given will converge to a root what I would suggest you do though is try this with another value I mean I just started off with X1 equaling one we know the root lies between Norton one so why not try as an experiment you could pause the video okay but try say X1 equaling 0.5 value midway between naught and one type in 0.5 into your calculator press equals and then clear it from the screen and that is your answer this formula just like this the answer minus answer Q Plus two times answer minus two all divided by three answers squared plus two and keep pressing equals and you should find that you get your next approximation X2 X2 turns out to be 0.81818181 or 0.81 recurring X3 do that turns out to be 0.7722 and so on X4 if you do that one turns out to be 0.7709 and so on and when you come to doing X5 you also get 0.7709 and so on so you can see by taking a different value here we still end up with 0.77 to 2 decimal places it converges to that route okay well I hope that's given you an idea then on how we can use the newton-raphson method then as another method of finding or locating a route but as I said earlier it does have one drawback sometimes it doesn't tend or converge to the root so you've just got to be aware of that problem okay well that brings us now to the end of this tutorial