 In this video, we're going to take a look at the solution to question six from the practice midterm exam for calculus to math 1220 So we're asked how large do we have to choose n so that the approximation using the trapezoidal rule tn to the integral We want to integrate from 0 to 1 cosine of x squared dx is accurate to within 0.001 Right there and so it also gives you a little bit of disclaimer here Notice if you take the the second derivative of cosine of x squared This will become negative two sine of x squared minus four x squared cosine of x squared And so on the interval on the interval zero to one one could ascertain that six is actually An upper bound for all of these numbers here and sort of the idea is sign You know sine of x squared it's gonna sit between one and negative one and so will cosine right cosine will also sit between these same bounds Right and so if you play around with that idea sine sits between one and negative one cosines as well The absolute value cannot exceed one So what could happen is this sign could go off towards one This sign could go off towards one and then for x squared the best it's gonna sit between zero and one as well So it could go off towards one so if you sort of think of worst-case scenarios everything becomes one one one one one one You're getting something like negative two minus four, which is a negative six if we take the absolute value of this You're gonna do with six it's not gives you some explanation where this six comes from is it the best bound not necessarily It's not but it's one what one could determine without a calculator whatsoever So how are we actually going to answer this one? So we have this idea about error and we need to work with that error here We're gonna use the error bound so we want to use the error bound associated to the trapezoid rule Which is a reminder the trapezoid rule error will be less than or equal to k times b minus a cubed over 12 in squared so that's the bound associated to the trapezoid rule and Some of these things we know the k value is given to you and you're gonna see that on the test as well I'm just gonna give you the k value Because what I want to see on this question is whether you can use correctly the error bound or not and Finding k turns out to be sort of an optimization problem something we saw in calculus one and although we probably should be able to do Optimization problems wink wink I'm gonna assume you can do that and so k will be given to you as a just as a time saver on this exam So then we plug in one minus zero cubed This it's above 12 times n squared and then again simplifying this we end up with 6 over 12 and squared Or more specifically 1 over 2 n squared like so now we want our error to be less than less than 0.0001 or in other words 1 out of 10,000 All right, so that's what I'm gonna do here And so we want to solve this inequality taking reciprocals We see that we get 2 n squared is greater than or equal to 10,000 and Divide both sides by two. We're gonna get the n squared is greater than or equal to 5,000 and so now we have to take the square root n is greater than or equal to 5,000 This is a step that you're gonna want to use your calculator And again, this shouldn't be a problem for most of us if we take the square root of 5,000 any scientific calculator can handle this You would get approximately 70.7 Now this n has to be an integer for which case we would round this up to the next highest integer and we would get 71 as our answer here now admittedly if you for some reason don't have a calculator I guess I mean honestly you should just use the the digital calculator will be provided to you during the exam So this is really sort of a mute issue But if you have your own physical calculator, you might want to use that instead Now a variation of this question of course is you could have a different function, of course given with different bounds But that mostly changes the fact how would one calculate k, which will be given to you The bounds of course are significant as they're part of the error bound right here You might you do need to know the error bound for the midpoint rule You also need to know the error bound for Simpsons rule because that does a that's a variation of this type of question here Another thing to be cautious about Simpsons rule is that if you're looking once you found your number Let's say you found 70.7 as it has to be good equal to that with Simpsons rule You do have to have an even number In which case you would then round that up to 72 and not 71 That is that that's a thing you want to watch out for on this question