Transcript
the following content is provided under a Creative Commons license your support will help MIT open courseware continue to offer highquality educational resources for free to make a donation or to view additional materials from hundreds of MIT courses visit MIT open courseware at ocw.mit.edu what we're going to talk about today is a continuation of last time I want to review Newton's method because I want to talk to you about its accuracy okay so if you remember the way Newton's method works is this if you have a curve and you want to know where it whether it crosses the axis uh and you don't know where this point is this point which I'll call X here uh what you do is you take a guess maybe you take a point x0 here and then you go down to this point on the graph and you draw the tangent line I'll draw these in a couple of different colors so that you can see the difference between them so here's a tangent line it's coming out like that all right and that one is going to get a little closer to the to our Target point but now the trick is and uh this is rather hard to see because the scale gets small incredibly fast is that if you go right up from that and you do the same trick over again that is this is your second guess X1 and now you draw the second tangent line which is going to come down this way that's really close you can see here on the chalkboard it's practically the same as the dot of X so that's the next guess which is X2 and uh I want to analyze now uh how close it gets and and just describe to you to how it works so let me just remind you of the formulas too it's it's worth having them in your head so the formula for the next one is is this and then the idea is to just to repeat this process which has a a fancy name which is to in uh algorithms which is to iterate if you like so we repeat the process and that means for example we generate X2 from X1 by the same formula and we did this last time and more generally the N plus first is generated from the nth guess by this formula here all right so what I'd like to do is just draw the picture of one step uh a little bit more closely so I want to blow up the picture which is which is above me there whoops that's a little too high where are my erasers okay got to get it a little lower than that since I'm going to depict everything above line here so here's my curve coming down and suppose that uh X1 is here so this is directly above it as this point here and then uh as I drew it this this green tangent is coming down like that it's a little bit closer and this was the place X2 and then here was was X our Target which is where the curve crosses as opposed to the straight tangent line Crossing okay so that's the picture that I want you to keep in mind and now we're just going to do a very qualitative uh kind of error analysis so here's our error analysis and we're starting out uh the distance between X1 and X is what we want to measure in other words how close we are to where we're we're heading and so I've called that I'm going to call that error one that's x - X1 in absolute value Val and then E2 would be x - X2 an absolute value and so forth and last time when I was estimating the size of this um so would be whatever it was last time remember we did it uh for a specific uh case so last time I actually wrote down the numbers and they were these numbers maybe you could call them n which was the absolute value of < TK 5 minus xn this these were the sizes that I was writing down last time and I just want to talk about in general what to expect uh that worked amazingly well and I want to show you that that's true pretty much in general so the first distance again this E1 is uh is is this distance here that's the E1 and then this shorter distance here this little bit which I'll mark maybe in green is is uh is uh E2 so how much shorter is E1 than E2 well the idea is pretty simple it's that if this distance and this vertical distance they're probably about the same as the same as the perpendicular distance and this is basically the situation of a curve touching a tangent line then the separation is going to be quadratic and that's basically what's going to happen happen so in other words the distance E2 is going to be about the square of the distance E1 and that's really the only feature of this that I want to point out so approximately this is the situation that we're going to get and so what that means is and U maybe thinking from last time what we had was was something roughly like this you have an e0 you have an E1 you have an E2 you have an e E3 and so forth maybe I'll write down E4 here and last time this was about 10 theus1 so the expectation based on this rule is that the next error is the square of the previous one so that's 10us 2 the next one is the square of the previous one so that's 10-4 and the next one is the square of that that's 10us 8 and this one is 10 -16th okay so the thing that's impressive about this list of numbers is you can see that the number of digits of accuracy doubles at each stage accuracy doubles at each step all right the number of digits of accuracy doubles at each step so very very quickly you get uh past the accuracy of your calculator as you saw on your problem set and uh this thing works beautifully so so let me just summarize by saying that Newton's method works very well by which I mean this this this kind of rate and and I I want to be just slightly specific if there are really two conditions disguised in this uh that are going on one is that F Prime has to be not to be to be not small okay and F Prime has to be not too big all right that's roughly speaking what's going on I'll explain these in just a second and x0 um starts nearby nearby the the target value X all right so that's really what's what's going on here and so let me just illustrate to you so I'm not going to explain this uh except to say the reason why the second derivative gets involved is that it's how curved the curve is that's how far away we get if it the second derivative were zero that would be the best possible case then we would get it on the nose if it's not too if the second is not too big that means the quadratic part is not too big so we don't get away very far from the green line to the to the curve itself the other thing to say is as I said that that that x0 needs to start nearby so I'll I'll explain that by explaining what what maybe could go wrong so so there the ways uh the method can fail and one example uh which actually would have happened in our um in our example from last time which was which was y = x^2 - 5 is suppose we'd started x0 over here okay then this thing would have gone off to the left and we would have landed on the um not the square root of five but the other root so if it's too far away then we get the wrong root all right so so that's an example explaining that the x0 needs to start near the the the roote that we're in talking about otherwise uh the the method doesn't know which route you're asking for it only knows where you started so it may go off to the wrong place okay it's it's not a it's not a uh it can't read your mind yes question oh good question so the the the other uh the question was what if the first error is larger than one are you in trouble and the answer is absolutely yes uh if you have quadratic Behavior you can see if you have a quadratic nearby it's pretty close to the straight line but far away a parabola is miles from a straight line it's way way way far away so if you're foolish enough to start you know over here you may have some trouble uh making progress actually it it it isn't when I that little wiggle there just meant proportional to in fact in the particular case of a parabola it manages to get back it saves itself but there's no guarantee of that sort of thing you really do want to start reasonably close yeah what you have to do is you have to watch out that is you you there it's hard to know what assumptions to make about x0 you you you plug it into the machine and you see what you get and uh either it works or it doesn't you can tell that it's marching toward a specific place and you can tell that that place probably is a zero usually but maybe it's not the one you were looking for so in other words you have to use your head you you run the program and then you see what it does all right and if you're lucky the problem is if you have no idea where the zero is you you may just wander around forever as as we'll see in a second okay so the next uh e example here is the following I said that F Prime has to be not too small there's a real catastrophe hiding just inside this picture which is the trans between when you find the positive root and when you find the negative root here which is if you're right down here you if you were foolish enough to guess zero then what's going to happen is your tangent line is horizontal it doesn't even meet the axis so in the formula you can see that's a catastrophe because there's an fime in the denominator all right so that's zero that's undefined it's not surprising it's consistent it it the parallel line doesn't meet the axis and you have no uh X1 so you had so if you like another uh Point here is is that frime Z is a disaster a disaster for this for the method because the next uh so say if f ofx z is is is zero then then X1 is undefined and finally there's there's one other weird thing that can happen which is which I'll just draw a picture of schematically which you can get from a Wiggle all right so this wiggle has three Roots the way I've drawn it and it can be that you can start over here with your x0 and draw your tangent line and go over here to an X1 and then that tangent line will take you right back to the x0 all right I didn't draw it quite right but it's yeah that's about right so it it it goes over like this so let me draw the two tangent lines so that you can see it properly sorry I messed it up so here are the two tangent lines this guy and this guy and it just goes back and forth x0 Cycles to X1 and X1 goes back to x0 we have a cycle and it never goes anywhere this is uh you know the Grass Is Always Greener it's over here it thinks oh I really would prefer to go to this zero and then it thinks ah I want to go back and it goes back and forth and back and forth grass is always greener on the other side of the fence never never gets anywhere okay so those are the sorts of things that can go wrong with Newton's method nevertheless it's fantastic it works very well and uh in a lot of situations and solves basically any equation that you can imagine numerically all right now next we're going to move on we're going to move on to something which is a little theoretical which is the mean value theorem and that will allow us in a just a day or so to launch into uh the ideas of integration which is the whole second half of the course so let's get started with that the mean value theorem will hence forth the abbreviated mvt so I don't have to write quite as much every time I refer to it the mean value theorem colloquially says the following if you go from Boston to La which I think a lot of Red Sox fans are going to want to do soon so that's 3,000 miles in 6 hours then at some time you are going at a certain speed the average of this speed average so speed which in this case is what so we're going at the average speed that's 3,000 miles time 6 hours so that's 500 miles per hour exactly so sometime on your journey of course some of the time you were going more than 500 mil hour sometimes you were going less and sometime you must have been going 500 mil hour exactly that's the mean value theorem the reason why it's called mean value theorem is that word mean is the same as the word average all right so now I'm going to State it in in in math symbols the same theorem and it's a formula it says that the difference quotient so this is the distance travel divided by the time elapsed that's the average speed is equal to the infinite tmal speed for some some time in between so some C which is in between A and B I'm not quite done it's a real theorem it has hypotheses I told you the conclusion first but there are some hypotheses they're straightforward hypothesis provided f is differentiable that is it has a derivative uh in the interval a less than x less than b and continuous in a less than or equal to X less than or equal to there has to be a sense that you can make out of the speed or the rate of change of F at each intermediate point and in order for the values at the ends to make sense it has to be continuous there has to be a link between the values at the ends and of what's going on in between if it were discontinuous there would be no relation between the left and right values and the rest of the function all right so here's the theorem conclusion and hypothesis and it means what I said more colloquially up above now I'm I'm going to prove this theorem immediately at least give a geometric intuitive argument which is not very different from the one that's given in a in a very systematic treatment so here's the proof of the mean value the it's really just a picture so here's a place and here's another place on the graph and the graph is going along like this let's say and this line here is the secant line so this is uh a comma F of a down here and this is B comma F of B up there there and this segment is the secant and its slope is the slope that we're aiming for the slope of that line is the left hand side of this formula here so we need to find something with that slope and what we need to find is a tangent line with that slope because this is what's on the right hand side is a slope of a tangent line so here here's how we construct it we take a parallel line down here and then we just translate it up leaving it parallel we move it up towards this one until it touches and where it touches at this point of tangency down there I've just found my value of c and you can see that if the tangent line is parallel to this line that's exactly the equation that we want so this thing has slope frime of and this other one has slope uh uh slope equal to this complicated expression F of B minus F of a / B minus a that is almost the end of the proof there's one problem so again uh we move a parallel line up move up a parallel line until it touches uh there's a little subtlety here which I just want to emphasize which is that that dotted line keeps on going here but when we bring it up we're going to ignore what's happening outside of a and Beyond B all right so we're just going to ignore the rest of the graph but there is one thing that can go wrong so if it does not touch then the picture looks like this here are the same two points and the graph is All Above and we brought up our thing and it went like that okay so we didn't we didn't construct a tangent line if if this happen right so we're in trouble in that point in this situation sorry right but there's a trick which is a straightforward trick then um uh bring bring uh the tangent lines down from the top uh so parallel lines sorry not tangent lines parallel lines from above all right so so that's that's the whole story that's how we cook up this point C with the right properties well I want to point out just one more theoretical thing and then the rest we're going to be drawing conclusions so there's one more theoretical remark about the proof which is something that is is fairly important to to understand when you understand a proof you should always be thinking about why the hypotheses are necessary where did I use the hypothesis and I want to give you an example where the proof doesn't work to show you that the hypothesis is is an important one so the example is the following I'll just take a function which is two two straight lines like this and if you try to perform this trick with these things then it's going to come up and it's going to touch here but the problem is that the uh tangent line is not defined here there are lots of tangents and there's no derivative at this point so the derivative doesn't exist here all right so that this is the claim that one bad point ruins the proof we need fime to exist at all so frime of x to exist at all X in between can't get away even with one defective point okay so now it's time to draw some consequences and the main consequence is going to be uh have to do with uh applications to graphing but we'll see tomorrow and for the rest of the course that this is this is even more significant it's it's significant to all the rest of calculus I'm going to list three consequences which you're quite familiar with already so the first one is if F Prime is positive then f is increasing and the second one is if F Prime is negative then f is decreasing and the last one seems like the simplest but even this one alone is the key to everything if F Prime is zero then f is constant these are three consequences now of the um of the mean value theorem and let me show you how they're proved I just told you that they were true maybe uh a while ago and certainly I mentioned the first two the the the last one was so so simple that we maybe just swept it under the rug you did use it on a problem set once or twice but it turns out that this actually requires proof and we're going to give the proof right now now the the way that the proof goes is simply to write down to rewrite star rewrite our formula which says that F of B minus F of A over B minus a is equal to frime of c and you see I've written it from left to right here to say that the right hand side information about the derivative is going to be giving me information about the function that's the way I'm going to read it in order to express this though I'm going to just uh uh rewrite it a couple of times here so here's F of a multiplying through by the denominator and now I'm going to write it in another customary form for the mean value theorem which is f of B is equal to F of a plus frime of C * B minus a right so here's another version I should probably have put this one in a box to begin with anyway and just changing it around algebraically it's this fact here they're the same thing and now with the formula written in this form I claim that I can check these three facts so let's start with the first one I'm going to set things up up always so that a is less than b and that's the setup of this of the theorem and so that means that B minus a is positive all right which means that this Factor over here is positive number if F Prime is positive then which is what happens in the first case that's the assumption that we're making then this is a positive number and so F of B is more than F of a which means that it's increasing it goes up as as uh the value goes up similarly if frime of C is negative then this is a positive times a negative number this is negative it's F of B is less than F of a so it goes the other way so maybe I'll write it this way and finally if frime of C is zero then F of B is equal to F of a which if you apply it to all possible ends means if you can do it for every interval which you can then that means that f is constant it's never gets to change values well you might have believed these these facts already but I I just want to emphasize to you that this turns out to be the the one key link between infinitesimals between limits and these actual differences before we were saying that the difference quotient was approximately equal to a derivative now we're saying that it's exactly equal to a derivative although we don't know exactly which point to use it's some point in between all right uh I'm going to be deducing some other consequences in a second but let me stop for a second to make sure that everybody's on board especially since I've finished the blackboards here before we everybody happy one one question I'm just going to repeat your question first I'm a little bit confused you said about what guarantees that there's a point of tangency that's that's what you said okay so do you want to elaborate or do you or you want to stop with that what you just said I mean what is it that confuses you about it yeah uh so so I'm not claiming that there's only one point this could wiggle a lot of times and it maybe Touches at 10 places in other words it's okay with me if it touches more than once then I just have more more the marrier in other words I don't I'm not I don't want there necessarily only to be one it could come down like this and touch a second time all right is is is that what was concerning you yeah yeah so so in in mathematics when when we claim that this is true for some point we don't necessarily mean that it doesn't work for others in fact if the function is constant this is zero and in fact this equation is true for every C that that satisfies your question okay all right all right it it it's it's a whether this the fact that this point exists is actually is a touchy point I just convince you of it visually it's a geometric issue whether you're allowed to do this indeed it it has to do with the existence of tangent lines and more analysis than we can do in this class yeah another question pardon me the the question is what's the difference between this and the linear approximation and I think so let me let me see if I can I can describe that I'll leave the theorem on the board I'm going to get rid of the coloquial version of the theorem and I'll try to describe to you the difference between this and the linear approximation I was planning to do that in a while but we'll we'll we'll do it right now since that's what you're asking that's fine so the here here's here's the situation the linear approximation so let's say comparison with linear approximation they very closely related the linear approximation says the change in F over the change in X that's the left hand side of this thing is approximately F Prime of a for B near near A and B minus a is equal to Delta X all right this statement which is in the box which is sitting right up there is the statement that this change in in F is actually equal to something not approximately equal to it it's equal to fime of some C and the problem here is that we don't know exactly which C this is for some C between a and and B all right so that's the difference between the two and let me elaborate a little bit if you're trying to understand what F of B minus F of a / B minus a is is the mean value theorem is telling you for sure that it's equal to this frime of C so that means it's less than or equal to the largest possible value on the the largest value you can get for sure and this is on uh the whole interval and I'm going to include the NS because when you take a Max it's sometimes achieved at the ends and similarly because it's frime of C it's definitely bigger than the Min on this same interval here this is all you can say based on the mean value theorem all you know is this and colloquially what that means is that the average speed is between the maximum and the minimum not very surprising all right the mean value theorem is supposed to be very intuitively obvious it's saying the average speed is trapped between the maximum speed and the minimum speed for sure that's something and that's why incidentally you know this wasn't really proved when Newton and livets were around but let's write this so that you can read it average speed is between between the Max and the Min and but nobody had any trouble uh they didn't they didn't disbelieve it because it's it's a very natural thing now if for example I take any kind of linear approximation say for instance e to the x is approximately 1 + x then I'm making the yes now no I don't want to say this yet that's that's not going to explain it to you well enough what we're saying so this is this is the mean value theorem this is what the mean value theorem says and here's the linear approximation the linear approximation is saying that the average speed is approximately the initial speed or possibly the final speed so if the if if if a is the left end point then it's the initial speed if if it happens to be the right end point if the if the value of x is to the left then it's the final speed so those are the so you can see it's approximately right because the speed when you're on a short interval shouldn't be varying very much the maximum in should be pretty close together so that's why the linear approximation is reasonable and this is telling you Absol absolutely it's no less than the men and no more than the max yeah a little Kink if you approach from the top so that if it's still under here I can show you it again oh yeah it's still there good oh the one with the with the wiggle on top yeah this one you can't because there's nothing to touch and it also fails from the bottom because there's this bad point from the top yeah it could work it can certainly worth both way so for example see if you're a machine you you you maybe don't have a way of doing this but if you're a human being you can spot all the places right there are a bunch of spots where the slope is right and it's perfectly okay all all of them work it's not that the C is the same it's just we've now found 1 2 3 4 5 c's for which it works if you're asked to find a c so first of all that's a kind of a phony question okay those are there's some questions on your problem set which ask you to find a c that actually is struggling to get you to understand what the statement of the mean value theorem is but you should you should not pay a lot of attention to those questions they're not very impressive but of course you would have to find all the place you could if it asks you to find one you find one if you if you can find some more fine you can pick whichever one you want mean value theorem just doesn't doesn't care the mean value theorem doesn't care because actually the mean value theorem is never used except to uh in in real life except in this context here you can never nail down which C it is so the only thing you can say is that you're going slower than the maximum speed and faster than the minimum speed sorry say that again if you're asked for a specific C you have to take get you have to find a specific C and it has to be in the range in between it has to be in here okay all right okay so now I want to I want to tell you about another kind of application which is really just a consequence of of of what I've described here I I I should emphasized by the way this probably I I was I I should be doing this I guess we've never used this color here it's popular this is pink so this one is so good so since we're going to do this all right uh so the the reason why I'm the exclamation exclamation points are temporary this is such an obvious fact but but this is the way that you're going to want to use the mean value theorem and this is the only way you need to understand the mean value theorem on your test or ever in your whole life okay so this is this is the way it will be used as I will make very clear when we review for the exam now in practice what happens is you even forget about the mean value theorem and what you remember is these three properties here which are themselves consequences of the mean value theorem so these are the ones that I want to illustrate now in my next discussion here these are I'm just going to talk about inequalities inequalities are relationships between functions and I'm going to prove a couple of them using the properties over there the properties that functions with positive derivatives are increasing here here's an example e to X is greater than 1 + x for X greater than 0 the proof is the following I consider so here's a proof I consider the function f ofx which is the difference e x - 1 + x I observe that it starts at F of0 equal to well that's e 0 - 1 + 0 which is 0 and it keeps on going frime of X is e to the X if I differentiate here the one goes away I get uh minus one that's the derivative of the function and this function because X is bigger than one for X positive is positive for X positive as X gets bigger and bigger this rate of increase is positive and therefore three dots that's therefore f ofx is bigger than its starting place for X bigger than zero if it's increasing then that's in particular particular it's increasing starting from zero so this is true now all I have to do is read what this inequality says and what it says is that e to the X just plug in for f ofx which is right here minus 1 + x is greater than the starting value which was zero and now I put the the the thing that's negative on the other side so that's the same thing as e to X is bigger than 1 + x that's of typical inequality and now we'll use this principle again oh GE I erased the wrong thing I erased the uh the statement and not the proof well hide the proof and uh the next thing I want to prove to you is that e to X is bigger than 1 plus X x + x^2 / 2 so how do I do that I introduce a function G of X which is e to the x minus this and now I'm going to just going to do exactly the same thing I did before which is I get started with G of 0 which is 1 minus 1 which is zero and G Prime of x is e to the x minus now look at what happens when I differentiate this the one goes away the X gives me a one and the x^2 over 2 gives me a plus X and this one is positive for X greater than zero because of step one because of the previous one that I did right so this one is increasing G is in increasing which says that g of X is bigger than G of 0 and if you just read that off it's exactly the same as our inequality here e x bigger than 1 + x + x^2 / 2 now you can keep on going with this essentially forever and let me just write down what you get you get e to X is greater than 1 + x + x^2 / 2 the next one turns out to be X Cub over 3 * 2 x 4th over 4 * 3 * 2 and you can do whatever you want you can do others and this is like the tortoise and the hair right this is the tortoise and this is the hair it's always a hair head but eventually if you go infinitely far it catches up so this is the the the the ACT turns out to be exactly equal to e to X in the limit and we'll talk about that maybe at the end of the course