 welcome back everybody this is lecture five wouldn't that be annoying if I had to talk like that every day it is funny I caught you off guard didn't I oh we're in trouble now Katie's Katie's going it's I sometimes do stats for the ESPN people that are on TV and it's funny how they'll be talking to you know like this and then the camera comes on ladies the gentleman you know it's like where'd that come from you know once you just talk like regular English I need to learn names so I'm for you see me looking at my seating chart looking at your face bear with me till I learn names if you go by a nickname that you know you know you didn't write on here because you felt like you had to write your formal name or given name then let me know that because I'm going to go by the name that you wrote down in class the first day we have one method of approximating the area under a curve when we can't integrate it we're going to try to wrap up the other method today and look at error estimates and that should keep us kind of on schedule on target for where we should be we have the trapezoidal approximation it should look something like this this is in your book you don't need to copy it but the first one up here we're going to try to integrate something that is not necessarily patterned or it's we don't have a table readily available and we want to use a trapezoidal approximation if you see a capital T with a little subscripted number then that's t4 t5 you can use any number here that's the number of trapezoids that you're constructing so it's delta x over 2 or h over 2 remember we factored out a one-half h f of x 0 to f of x 1 to f of x 2 and all the others have a coefficient 2 till you get to the last one it's only in there once so basically the first one and the last one are entered in here once I don't know why is that true how how in the world could you remember something like that where the twos come from okay there we go these trapezoids when you put them where one ends the other one starts that base if you want to call it that that side is shared by two trapezoids therefore it ends up in the formula twice so it would have been one to one right if we had one trapezoid but that other base is shared so it ends up being in there twice and basically all of them end up in there twice except the first one which is not shared and the last one which is also not shared delta x b minus a over n we did that x sub i I don't know if I wrote this down exactly this way yesterday but if we want x sub 0 we start with a and we add delta x in 0 times x sub 1 is a plus 1 delta x I think I wrote it this way instead x sub 3 would be a plus 3 delta x's and so on so x sub I in general is a plus I delta x we did look at an example I think we use 1 over x so we could check it the area under 1 over x from 1 to 2 is exactly the natural log of 2 but an approximation of that was 0.693 I don't know if we went any further than that 315 maybe and then we got point we did how many trap how many trapezoids did we do four trapezoids and we got close to that I think we got 0.697 so we did either T4 or I think I wrote it yesterday trap 4 so we had four trapezoids and we got the area under this curve this area the nice thing about this example is we can check it we know what the exact answer is with four trapezoids I think we got 0.697 that sound right and this is exactly the natural log of 2 which is approximately 0.693 so we did reasonable we had an error in the third decimal place that's pretty good accuracy for just four trapezoids so at this point we want to jump to the other one where are we with respect to the other one I think we left off with the fact that if we start at x 0 I'm going to go ahead and have this arbitrary parabolic lead to this region pick up x1 and then we'll so basically the parabola that we're forcing to contain the top of this should be a little bit higher accuracy you'll see that will kind of looks like the same but it's actually two parabolic regions we can be more accurate with two parabolic regions than we were with four trapezoids so the accuracy is a lot better by the way there's a third method in the book just to point it out in case you read the book and you say I wonder if we need to know that there is a midpoint rule the bottom of page 412 it's kind of right in there at the level of the trapezoidal approximation so I just chose one of the two and I happen to choose trapezoid so we're not going to do I'm not going to ask you to be responsible for the midpoint rule very similar to the trapezoid rule and there's actually a reason why I chose the trapezoid rule because I think it leads real nicely into Simpson's rule so with this now it looks like two regions if you want to kind of compare and contrast with the trapezoidal approximation it kind of is two regions as far as determining h or delta x so this is still h and h will call our delta x which is still going to be b minus a over n but it's kind of halfway through the parabolic region we're still going to call it h I think we got to the point yesterday where we had the area with Simpson's rule and it's approximately equal to the actual area under the curve h over three I think we got to that point y0 was in this position and we decided that y0 was really f of x0 what was the coefficient of that middle one that we were trying to pick up that point where the dotted line is that was a four I think we kind of ended class with that right that's where we left off for h you can plug in delta x and we're still okay with that now let's suppose that we want to throw in the next parabolic region so I want my starting segment to be here I want the point in the middle to be x3 in my end one to be x4 so I want the parabola the arbitrary parabola to capture those three points so what's it going to look like let me move this there's our first one so our next one we'll have an h over three out in front my starting value was x of two so shouldn't I have f of x2 plus four f of x3 plus f of x4 does that seem to be the case for the next one here's the picture so I want one of these four of these and one of these so what happened to at x2 wasn't that line segment or that distance that f of x2 wasn't it in the first parabolic region and also the second and won't that be the case if I continue x4 will be in both of them so what's going to happen when I try to group those things together well I'll factor out the h over three I've got f of x0 do you see another f of x0 that's the only one I've got four f of x1 do you see any other f of x1 that's it now we start the overlap here's an f of x2 and here's another f of x2 so we've got two of them here's four f of x3 do you see any other f of x3 now here's an f of x4 will there be another if I were to continue this with another parabolic region there would be another f of x4 you don't have to write quite this many but this is the first time we're writing it down so I'm going to write enough to establish the pattern f of x4 there'd be what four f of x5 and let's go ahead and stop this thing at three parabolic regions there'd just be one right f of x6 is that right so if we were to stop it at three so we see the pattern we've got one f of x0 we've got one f of x6 and then the pattern is that we're alternating fours and twos beginning with a four and ending with a four until we get to we've exhausted the the number of parabolic regions so you could call this two different things you could call it we'd call a lot of different things but they wouldn't make sense you could call it simp in in a sense you kind of have six regions but there are just three parabolic regions there are three different times we had this one four one configuration one four one one four one but it looks like on the picture I'll dress this picture up just a little bit more so there is x5 and there is x6 so there's our third parabolic region but it kind of in a sense you can say one two three four five six if you're going the number of times you move delta x from left to right but three pair and I'll try to identify it as both this would be either simp six or simp three parabolic regions now if you use six you always have to have an even number and the authors address that in the reading and I do encourage you to read the material that's in the book but you can have as many parabolic regions as you choose it could be even or odd but since each parabolic region includes two other regions that's why it's always got to be even if you call it like simp six or simp eight or simp 12 12 would mean six parabolic regions 10 would mean five parabolic regions so it's all based on the the top of the region being a parabola even though we're capturing that point in the middle so to summarize that one before we look in an example here's what simpson's rule looks like h or delta x over three now they call this s sub n the way they refer to it it would be n would be an even number and it'd be kind of the number of delta x as you're crawling along f of x zero it's in here once f of x in which is whatever your last one is in here once the next coefficient is four the next to last coefficient is four and you're alternating the fours and twos so that's the reason why i choose to look at trapezoidal approximation because it has this similar kind of sharing of sides that cause these to all be two and for us to alternate in fours and twos it'd be nicer if it were twos and fours that'd be 24 which is clearly the best show on television okay so other than this other than this class on five p.m uh on every day channel 18 second in the ratings i'm certain would be 24 which we just had two hours of premiere and then the very next day we had two more hours so it's just like have it now we've got to wait another week to see another version of 24 all right any questions about the formula any of you watch it 24 pretty good isn't it uh i won't tell you about any of the things about jack bower and what he did and didn't do but it's good uh let's look at an example so let's look at an answer that we know the exact answer natural log two approximately 0.69315 i think and we did four trapezoids and we got 0.697 let's just do two parabolic regions so it kind of looks like the same diagram because our delta x will be the same so we're going to come out here a quarter of a unit so our h is going to be a quarter or delta x b minus a over n so it's one fourth so it looks a lot like the kind of the trapezoid set up we had yesterday but just basically two parabolic regions so why am i calling it a parabolic region where'd that come from just made up a name histographic maybe it's a histographic region just a name i just made up does it work histograms remember those i'm stretching it there i just came up with another word um two parabolic regions how did you get n to be four because there are four kind of stopping places along the way uh when i call this a parabolic region and by the way what's the answer to that question why is it a parabolic region because the top is a parabola right so that's we're forcing this parabola to grab all three of those points so the fact that we're forcing it to grab this point in the middle we're establishing this as kind of a sub region or it's a part of the parabolic region but that's still classified as h because we wanted the area under this curve and i know we did this kind of quickly but we went from x zero to x zero plus two h so by the time we started here and ended here which is the other side of the parabolic region we had moved over to h so that means the middle point is over h so that's where this kind of formula came from chain like does it make it more accurate by doing that like to make it a parabola now if you didn't have that middle it wouldn't technically be well there's a whole bunch of parabolas that could capture this point in this point yeah but the fact that you force it to go through here that guarantees kind of makes it stay closer to the curve okay did i answer your question all right nicole yeah okay so let's uh go ahead with just two parabolic regions seemingly less accurate potentially than four trapezoids but it's going to be actually a whole lot more accurate so this area so it's okay to call it four because there are in a sense kind of four regions or you could refer to it as just two parabolic regions so we want tell me what to write down here how do we start with simpson's rule that's right so one fourth over three so it's h over three or delta x over three okay i'm going to call it five fourths plus two f of plus four f 1.75 plus f of two once again proof that i'm not needed okay i'm just kind of here to write stuff down that you tell me everybody go along with that so you always have a quick visual check is the first entry and the last entry do we have one of those yes the second entry and the next to last entry do we have four of those and then are we alternating fours and twos we are so f of one what is our function that we're trying to approximate the area under one over x so it'd be one over one four of these what's one over five fourths four fifths f of three halves what's one over three halves two thirds kind of some similar numbers that we had yesterday with trapezoid but different coefficients one over seven fourths four sevenths and the last ones in here once f of two is one over two so there's our arithmetic that's supposed to get us a reasonable approximation and i think we'll find that actually accuracy is a whole lot better with simpson's rule and we'll talk about errors associated with them and you'll see just by how the error is written out that it is going to be a whole lot more accurate um let's just go one step further what do we have here 16 fifths plus four thirds it is an approximation so let's use our calculator to take it from here three three okay a lot better accuracy i think the other one is point six nine three one five if you did natural log of two somebody check that just punch in natural log two point six nine three one five okay so we're at six nine three so we've got accuracy to this column and so our first error is in the fourth decimal place quite a bit better actually than we got with trape four because we got point six nine seven not awful but this is a whole lot better any question about the kind of the arithmetic or the the format of how we use that approximation this is called numerical integration did any integration take place no we didn't integrate anything it's kind of imitating that in the sense that we're getting to the same answer but we did not integrate we're doing it all numerically there's a great example in your book urge you to read this one i do want to point out a couple things about it it's at the bottom of page 418 it's got a real kind of edgy curve um and the what this curve is is d of t is the data throughput measured in megabits per second use simpson's rule to establish the total amount of data so here we've got a rate at which data is being transmitted megabits per second so it's a rate so if we anti differentiate this rate what is a rate isn't it a first derivative it's the rate of change of something so we're anti differentiating kind of we're imitating an anti derivative what would you expect the area under this curve which is megabits per second to be megabits right so you can if you have some data we don't have a function we just have data points there's a table by the way on page 419 so we don't have to actually try to read the chart read the graph so you can do the same process if you don't even have a curve you just have a table of data and if the curve itself is a rate of change then you're going to find whatever that is the rate of change of you're going to find that amount by finding the area under that curve so that is done so you probably ought to take a at least a brief look to see that they're doing the same thing there they've got four of the second entry two of the next one four of the next one and so on in their work here so it is megabits per second area under that curve is megabits and they still use Simpson's rule no function is known we don't need it we just have a table of data the bottom of 419 and where's the other one on page 415 and I'm not going to ask you to memorize these but I do want to take a brief look at them today in class actually yeah this is as good a time as any to do that the error bounds or the error estimates associated with these so you can look at the error associated with Simpson's rule and that associated with trapezoidal rule so here are the error bounds so we want to pay attention to the one that we looked at which is trapezoidal this is the midpoint rule which we're not examining in this class so here's the error associated with trapezoidal approximation this type of numerical integration where this comes from is actually in another math course it's in a math course probably the first time you would actually derive this is in math 425 which we're not there obviously we're in 241 this can be derived it's not you know something that's absolutely ridiculous to get there but we're not that's not part of what we're doing in this class so we'll take what's handed to us and then we'll try to examine it and see why the error associated with trapezoidal approximation is larger than the error associated with Simpson's rule approximation so the error absolute value so we don't know if we have too much or too little so it's just how far away from the answer are we going to be what's the absolute value this k we need to examine what the k is but setting that aside temporarily we would take the values that have been given to us in the problem b minus a that quantity cubed over 12 n squared where n is the the number of sub regions that we have in our interval by the way i think i explained why i chose the trapezoidal rule if you compare the error associated with the midpoint to the error associated with the trapezoidal approximation which do you think is better b minus a cubed we've got it over here n squared we've got it over here this has a 12 and this has a 24 who 24 that's the best show on television i knew it'd get integrated here somehow today if you have a larger denominator doesn't that mean your error is smaller so midpoint actually does a little bit better right the error would be half as much as trapezoid but i did have a reason for examining trapezoid so that it would kind of lead us a little better into simpson's rule now what is this k k is the maximum value of the second derivative over this interval from a to b so if you find the second derivative of the function by the way this is going to be really difficult to do when you don't have a function right you just have a data set then we're going to be out of luck with the error bounds but the maximum value of the second derivative over the interval and we'll do an example problem to figure out what these would be for the two examples that we've chosen to do thus far so let's see what that looks like let's see what that looks like before we examine the error bound for simpson's rule so we did a problem we approximated this time permitting i'd like to for us to do another problem that is a little bit more complicated than one over x so you can see that you know this is a good first example but it's a little too simplistic possibly so our a is one our b is two and we did four trapezoids so n was four so the error for us i'll leave out the k value right now we'll come back to that b minus a that doesn't really get all exciting doesn't two minus one cubed over 12 times n in is four squared now let's look at this k value that's going to occupy this position we need the second derivative so our original f of x is one over x first derivative is what no that'd be going the other way we want to derive that'd be integrating negative one over x squared so it'd be negative one x to the negative second good positive two x to the negative third or two over x cubed so we want to maximize that on the interval in question what's the maximum value of the second derivative notice where x is x is in the denominator so if we want to make this fraction as large as possible we want to make the denominator as small as possible right not as large as possible so that's going to happen at one right so this k value that we're looking to insert here the maximum value of the second derivative over this interval is two over one cubed or two over one or two right so there's what kind of error we should expect with the function that we had one over x and the limits that we had from one to two and the number of trapezoids that we had which was four so let's see what that is numerator is what two denominator is one over ninety six somebody give me a decimal for one over ninety six zero one zero four now that's the maximum error that we're going to have now we actually found the error to be in what decimal place we got the point six good the next one was a three and that was good right and then we found an error in the next column so we actually found the error to be smaller than this this is the maximum this is the error bound it's the most error we're going to have so it says at the most when we do this process with this function over this interval with this number of trapezoids that's the largest our error could be that's not too bad we actually found it to be smaller than that questions on this this is probably not a test question okay i'm not going to ask you to evaluate the error bound there is another way to use error bound that i think is more helpful than this if you want to if you want a certain level of accuracy how do you use this fact to guarantee decide how many subintervals you want to get that desired level of accuracy that's a more valid problem but this is almost kind of after the fact all right error bound associated with simpson's rule now let's kind of compare and contrast things that we see down here with things that we saw up here with the error estimate associated with trapezoidal approximation we've got a k we'll examine that in a minute it's different than the k was up here b minus a to the fifth as opposed to b minus a cubed may or may not have an impact but it's in the numerator doesn't have an impact on this problem right because b minus a is two minus one which is one no difference between one cubed and one to the fifth now let's examine the denominator now you start seeing some differences where there was a 12 you see a 180 that's a big difference that says already it's going to be a whole lot more accurate and where there's an n squared now we've got an n to the fourth so if n is four instead of having four squared or a 16 down there we're going to have a four to the fourth which is 256 is that right i think that's right so our denominator is a whole lot bigger which means that the error is smaller we did a whole lot better with the approximation with simpson's rule then we're going to be able to do with trapezoidal or if we chose to do so midpoint approximation now what is the k value this k value i don't even know what that means what's that notation fourth derivative right actually i do know what it means i was kind of seeing for just to see if you knew what it was when you see a superscripted four it means we're tired of making all the little tick marks right let's put a superscripted number up there so that's the fourth derivative of the function is smaller than k so we want the this to be the maximum value i'll go ahead and put them here maximum value of the fourth derivative on our interval from a to b this is a whole lot more accurate simpson's rule is a whole lot more accurate than either trapezoidal or midpoint approximation so let's see what our choice what kind of error so we'll leave out the k value right now b minus a to the fifth 180 n now the n they're talking about here is the the even number of kind of stopping places that we go along the way this is not the number of parabolic regions so n is still four for the problem we did now what about the k that occupies this position so we got this far last problem i think that'll work 24 we would expect the next one to be negative right so we're going to alternate and sign sigm as we go 24 over x to the fifth that work so the one we're skipping here is what negative six so we want to maximize that on our interval from one to two again x is in the denominator we're going to maximize the value of that fraction by making the denominator as small as possible as opposed to as large as possible so what do we want one right here's another reason why this is a good first example can you imagine if this is let's say the function is x times the cosine of x and we've got to work our way to the fourth derivative we may not have enough class time to do that so we're trying to actually look at examples that would fit in the class period so there's our k value so what do we get for the numerator 24 gosh that just kind of keeps coming up doesn't it 24 best show on tv other than this 241 broadcast four to the fourth 16 times 16 256 check me on that so what do we get out of that so what is that error the maximum error approximately for this problem so our error would be less than or equal to what is this as a decimal five now we actually did the approximation we got 0.6933 is that right don't tell nicole what we were that's don't tell her what we discussed there because that's kind of a secret sorry just you know you missed it sorry isn't that where we decided our error was right the fourth decimal place and in fact it may not even be that large because i think the calculator version for the natural log of two is 0.6931 five and we had 0.6933 so this is the error at its maximum we didn't find it to be this much if this turned out to be the exact error if this is crossing your mind wouldn't we always be able to find the exact value by taking our approximation and either adding or subtracting our exact error it's not exact error it's kind of the worst that your error could be so it's just to give you a general idea we think we've got a pretty good answer how good is it how reliable is it this this is what's going to tell us that so it's it's an error bound it is not the error itself this is probably a mistake but if you have your book and you'll look at page 421 you'll see starting with problem seven seven through sixteen are some problems that say use trapezoidal rule the midpoint rule and simpson's rule let's pick a method not all of them and let's pick a problem in there that's where i'm probably making a mistake one that looks a little worse than one over x that was pretty tame for our first example but maybe not the most hideous one in the list 10 okay 421 problem seven through 16 so if you want more practice on this because what you see in web assign is quite enough and sometimes that's the case in this class then pick an odd numbered problem in here and pick either trapezoidal rule or simpson's rule do the problem and see if you match the answer that's in the back of the book so 10 was suggested zero to three that's a considerably worse but it's not the worst of those problems in this set and they say n equals six let's go ahead and use that i don't care trapezoidal simpson's rule and by the way i give you that choice on the test oh i will say you choose trapezoidal or simpson's rule you you do the do either approximation which do you want to do right now simpson's okay so this simpson's rule with six regions is really just three parabolic regions but we've got kind of these six stopping places along the way we don't need a diagram we kind of on our first example we paired that with a diagram i think that served its purpose i don't know does anybody see another way to do this problem does anybody see a way that we could actually integrate this possibly partial fractions if this were to factor is t to the fourth plus t squared plus one is that going to factor that's good i mean those are those are things that you ought to think about when you're looking at a problem and then you go through that same thing i don't know how many times i do that when i try to kind of mentally go through a problem yeah maybe that maybe that no it's not going to work okay what what did i just waste four seconds okay so you're not going to waste like tons of time by saying let's try this let me think about this no it's not going to work i don't think we're going to factor that uh if it were to factor then that would be a good recommendation because we'd have probably two irreducible quadratics we could decompose into partial fractions and go from there but i don't think we're going to have that luxury this may be the only way to do this problem as is the case with probably every one of those in seven through sixteen in that problem set this may be the only way to do the problems is to approximate uh get me started here delta x is one half b minus a over n which is one half so our area with this level of approximating either six kind of stopping places or three parabolic regions going to be one half over over three let's just write the kind of the functional notation now and then we'll clean it up f of zero two f of two four f two point five yeah and f of three the coal is our designated simpson's rule gal and we will tell you what we discussed when you were out of the classroom because you reinstated yourself with that okay are we good with that zero is the first one three is the last one next one is four next the last one is four all the others are fours and twos alternate i think we're good with that so one half divided by three is the same thing as one half times one third f of zero is just one right put a zero in there for t four f of one half so isn't that going to be one over one half squared plus one half to the fourth is that delightful looking is that right not delightful looking but it's kind of we're stuck with that unfortunately two f of one that should be a little bit easier what's f of one one third right one plus one squared plus one to the fourth now we go back to the bad ones one over one plus three halves squared plus three halves to the fourth f of two what's f of two one over 21 got a consensus there on that what do we need here four write that down here f of five halves who picked this example who was that no i mean they're all about same and f of three is in there once three to the fourth is 81 three squared is nine so that's 90 91 is that work so i would fire up the calculator it is an approximation so let's let the calculator do the so-called ugly work as long as we know we're gathering the right things along the way and we should have a reasonable probably a pretty good approximation based on that error bound that we looked at earlier uh for this i will do this one you do this one before next class and we'll see what we come up with and then i'll also do the error bound to see if we're kind of within that ballpark so this should finish us with 5.9 so we'll kind of type a couple loose ends at the beginning of class tomorrow and forge ahead into 5.10 appreciate your attention