Now we're going to talk about Newton's method. Okay, so Newton's method, If I look at this same equation, if I just want to blow it up right here. Oops rrong equation. There we go. What I'm trying to find is this point, right? So, if I had an initial guess that say is here, right? So this could be my point. I'll call that point that will be the point (x,n,. So the nth gues f(x,n) and if that's my point and height there. If I did a tangent line there and found were that intersected and that gave me my next point, right, then that would be much closer to the root. And then I could do the same thing again and then the same thing again, right. So this is going to get me there a lot faster. So how do I get what this point is, right? So once I have a point, how do I find that point? Well, let's see, I could take the difference in the Ys, the what at this point I'll call this one, my next one and that's going to have a height of 0. So the difference in the Ys, over the difference in the xs is the slope of this line, right. The difference in the Ys divided by the difference in the Xs. So that's the slope, what's the slope of the tangent line? That's the derivative at that point, right? So we can you have another use for our derivative. Okay, so I have F(Xn) is equal to because the minus zero goes away. F prime at (X n) times (Xn +1- Xn ), divide through by F prime, And I have that let's see. Oops, I did these backwards. Sorry, if I did the F(Xn- 0), this has to be (Xn- Xn +1). Something wasn't correct right there. Okay, so let's fix that. So if I bring the Xn, if I want the Xn +1 on this side and bring this to the other side. There we go that looks more better. Okay, so this is Newton's method formula and it just comes from looking at the tangent line at a point and figuring out where the next point is. So this gives me my next guess and then I use that one as the next guess. So let's see how this would actually work. Let's find that by taking the number two is my initial guess. Okay, just show you how this works. So, my initial guess is 2 okay, so my next guess. So I'm going to have 2 for this, I have to know f pre med X. So F prime at X is 2X. Right from that take the derivative I get 2x. So to get X1 is going to be X knot minus F(X),k not divided by F prime at X knot. So that's going to be X knot was to f of 2. F of two is four minus two or 2, f prime of 2 is two times 2 just 4. So I get 2 minus a half which is 3/4. Okay so that becomes my X1 now I just do it again. So that's my X1. So now I find this is X1 so to find X2 It's going to be X1 minus F at X1 divided by F prom at X1. Okay so X1 was 3/4 or 1.5, F(X1). So F( X 1) is three halves squared 9/4 minus two is 1/4. So I get 1/4. I'm mixing up decimals and fractions sorry and 3/2 times two is 3. Right, so this would be X2 let's see what is that? 1.5- 1/12. What is 1/12? Well it's 3/2ves -1 12th which is 6 18, 12 -1 12th which is 17/12 and that's my X2. So this is going to converge. So the pros and cons here for Newton's method. Well the good news is it converges very quickly. That's the good news. Right I solved this one and I only have to have one point to start with. The bad news is that it may not always converge. Or it could converge the wrong place. And let's think about how that would work. So what could possibly go wrong with Newton's method? Well, suppose my function looks something like this, And I picked my initial point to be say here, okay, so let's think about graphically what it's going to do, then it's going to take me to here is my next point. And then that's going to take me to their for my next point, and that's going to take me to their for my next point so forth. So it's just going to bounce me back and forth because my initial choice wasn't close enough to my solution. So I have to be fairly close to my solution for this to work. And the other thing is I have to know the derivative. So I didn't put that on my list. So I have to have the derivative in order to do this. So those are the negatives of Newton's method. Okay, so you should know like each different method for a numerical solution. They're going to have times it works, sometimes it doesn't work and times one works better than the other. And sometimes people will do things like combined methods, like maybe I'll use a Bisection method to start with to be sure I'm close to the solution. And then switch over to Newton's method to go to get converging quickly to the exact answer. Now, when I say exact answer, remember this is an approximation. So one thing you should be aware of with computers right is they're never going to be able to give you like an exact answer for square root of two. We can write that and we know what it is but if you go on your computer and I'll just do this in our right, if you did that is square to two and I did y is x squared power of 2, sorry. Then and I do Y = 2 it will tell me false. Right, but we know the squared of two squared is two. But what's happening is in my computer, it's only representing this to so many decimal places. So when it squares that even though it looks to your screen, like the answer is 2 if I displayed y it would look, I would say 2. But if you check it out it's not exactly equal because somewhere in the 32nd decimal place or something, it had a round off error. So that's the thing with all numerical analysis and numerical solutions, you have to worry about round off error and whether things are exactly equal or not. Okay, so you will look for functions like near or approximately equal to or something like that that says it's basically equal except for round off error. Okay, so look forward to Dr Bird coming in for the next lesson on a little more numerical techniques for doing singular value decomposition and other things that you can do with matrices. Thanks so much.