 All right, so I'm sure you all had fun by something. Yeah. What? Where I can get one of those ducks, they're very, very hot. Why that one? No, don't let it turn to one end. I keep hoping someone would. Actually, somebody drew one on your test. Okay, so the class started. Remember that? Yeah. So the midterm, they'll be graded. I will post the grades on the webpage over the weekend once I have them. We expect to finish grading, maybe tonight, maybe tomorrow morning, something like that. It takes a little while because everybody grading has classes and stuff like that. And there's three hundred and seventy papers in grade. So it takes a little while. I don't know, so anybody? I don't know. So you may have noticed I don't have a computer today, so no clickers today. I know it's breaking your heart, but there it is. So the midterm is what it was. Okay, so what we did before and we've done so far is this business with volumes of, well, volumes of known cross-section. This is usually revolution services and revolution, but not always. And really the way you do those is you think about what does the cross-section look like and you integrate it. So because the idea is that an integral like this is just, this means add of, well, an integral of a u. So if we integrate something, it means add up lots of those guys to find some skinny bit, right? So when we're doing areas, we take a lot of skinny rectangles and they add them up to give us an area. If we're doing, it's easier for me to draw these things this way. If we're doing volumes, then we add up lots of skinny slices and it gives us a volume. So we can, oops, go up. We add up lots of skinny things and it gives us something like a volume or lots of lines to give us an area and so on. So we can apply this to other ideas as well. So the next idea that I'm going to turn to is, I guess, a little bit here, is to find the length of a curve. So if I have a piece of rope and it's laid down in some, let's say it doesn't matter, laid down in some length and I want to know how long is this rope? Well the easiest way, of course, if it's a piece of rope or a piece of string, is to just stretch it out and know how long it is. So sometimes you can't do that. If I want to know, you know, I have some curved shape and I want to know how long it is but it may have a concrete, it might be a little bit hard for me to just pick it up and measure it. So another thing that you can do is you can chop it up and measure it on segments where it's mostly straight. So that would be, I can measure it on segments where it's mostly straight. I think that's about the same amount. So I can just measure here. So this is 1, 2, 3, 4, 5, 6, 7, 8. So this thing is 8 of those long. So how can we formalize this idea into something that we can use calculus to understand if we know that this length is given by some function. So suppose my question, is it clear the question I'm asking? So for example, which I won't do the example first, how long y equals x squared for x from 1 to 2? So that's the kind of question I want to answer. I draw the graph of y equals x squared. Well, y equals x, that's still a bit. I draw the graph of y equals x squared from 1, did I say 1 to 2? Okay. That's 2. This is 4. This is 1. Well, that's supposed to be 1, 1. It's a terrible picture. Let's draw it again. y equals x squared. So this is 2. This is height 4. It's still bad. This is 1, 1. It's about that. So how long is this chunk of graph? So without doing any calculation, is it bigger than 1? Is it, yes, it's definitely bigger than 1. Is it less than 20? Okay. So at least we have some idea. It's between 1 and 20. Is it less than 5? Less than 4. So what are you doing in order to make these estimates? We have this piece of curve here. I'm trying to guess how long it is. And I know it goes through this point, 1, 1. And I know it goes through this point, 2, 4. And everybody quite easily said that it is longer than 1. Is it longer than 2? Is it longer than 3? So it's somewhere between 3 and 5. So in order to get, so we can estimate this by saying, well, how long is this? It's certainly longer than that. So it's certainly longer than the distance between this point and that point, which is the square root of 1 plus 9 square root of 10, which is between 3 and 4. It's certainly bigger than, and it's certainly less than this, which is 1 plus 3. So it's between square root of 10. So suppose I wanted to make my answer better. What would I do? Wait until the professor tells me how to do it. All right. No. Okay. What would you do in grade? So I have to work it out. I just, you know, here's a curve here. And you want to know how long a piece of rope do you need to lay it along that curve? What would you do? We measure it somehow, right? Take more slows. Take more slows. Sure. So instead of doing this very rough picture, do this rough picture at more points. Go here to here, there to there, there to there, there to there to there. And you do a better answer. Just keep going like that as much as you want. So I would take this length, this length, this length, this length, and this length, and I would add them up. And that would give me a better answer. I could just continue in this way. If this answer isn't good enough, this answer is probably, you know, not that much. If that isn't good enough, do it a million times. If that isn't good enough, do it a million times. If I want to measure how long, so I have these curves made by the stairs, if I want to know how long these curves are, I could measure it by taking a yard stick and laying them down end to end and adding up however long my yard stick is. I could also take, take something a millimeter long and just lay them down there and go along with a millimeter and that would give me a much better approximation. And if I didn't have a millimeter stick, I could use a nanometer, but I would have to be a very patient. But you get a very good estimate if I go to a very small scale. So that's the idea we're going to use here. So if we have a function y equals x squared is developed in acetone. So we have some function y equals x squared and I want to figure out how long this curve is on a very small scale. So I'm going to measure just a little bit. So this is blown up. I've blown this way up. I've zoomed way in. So this is some tiny amount. dx. That's this distance. This distance is what? dy. For y equals x squared, what's dy? If I tell you dx is 0.03, what if dy for y equals x squared if I tell you that's near x equals what does it matter? What do you need to know when you calculate dy? Why have you 0.09? It depends on where x is. My function is y equals x squared. So what is dy? Y equals x squared. 2x dx. You guys always forget the dx. The dx is important. It's 2x times this length. If I tell you that this length is 0.03 and the x here is one and a half then the length of this is 3 times 0.03. dx is a tiny little amount but it's an amount. You can't just forget it. So how long is this? How long is the hypotenuse of the right triangle where one side is dx and the other side is 2x dx? What do I do? I use the Pythagorean theorem. I use that already. So I can use the Pythagorean theorem. I have a triangle where this side is dx and I keep drawing a let's make it smaller than it is. This side is dx. This side is dy which in this case is 2x dx. And so this length is this square plus this square. Let me just write it as dy squared. Take the square root. Or in this case where it's 2x dx this is I can factor the dx squared out that's the length of this. And if dx is really, really tiny that's very close to the length of that little section of curve is I replace this little section of curve by a straight line again thinking dx is a tiny little number and that's how long it is. And then we use this idea that if we integrate lots of tiny little things we can get a big thing. So that means that length so I want to take the limit as dx well as the number so I want to add up lots of these things and that would give me my length. And I take the limit as the size of the segment goes to zero. So that is an integral. The integral of this thing 1 plus 4x squared dx from, well let's see, I wanted the curve from 1 to 2 this is the length of y equals x squared between x equals 1 and x equals 2 y equals 4 but I hope it should be clear to you how to do that for anyone. So this is the arc when formula only in this special case special case with the curve y equals x squared we can do this integral by a trig substitution right? You all learned that. Does anyone want me to do this integral? I can do it. Yes? No. Does anyone want to see the actual number here? Sure. Why not? Alright, so if I want to do that integral make the substitution x equals well, so here I really think of this as 1 plus 2x quantity squared is what it started with anyway and I make the substitution at 2x no I want to think u is 2x and so I want the arc tan of 2x I mean the tan of 2x what am I doing? u, I want 2x squared why is my brain firing? Because I'm not too late. Alright, so let's do it in two steps because my brain is broken so this is 2dx so this becomes 1 half 1 to 2 squared over 1 plus u squared du now I make the substitution u is the tan theta so du is the c squared theta and so this is 1 half oh and so u is the tan when when oh this is not 1 this is now 1 half this is now 1 right? because u is 2x 2 and 4 okay so u is 2 and 4 now I have I want to convert that to in terms of theta so this is the arc tan of 2 the arc tan of 4 I don't know either of these let's see the arc tan of 2 I should know but the arc tan of 4 I know so those are some angles and u is the tan so I have a 1 plus a tan squared so that's the square root of the secant squared so that's the secant square root of the secant of theta so this is 1 half the log I absolutely hate this integral so it keeps showing up secant theta plus tangent theta arc tan from arc tan to arc tan what happens to the secant square for du? you went away what do you mean no? now it's the secant q because I forgot it and I didn't like it and I didn't like it so now this is the secant q and now I don't want to do this and so on it's over so there we go so I'll leave that to you okay so let's do the general idea you can do that on your exam too you can partway write in and so on I need a portion of credit I need a portion of credit I do you do well I don't care I just want to ask I don't care if I get an A I'm happy with a C so you can do that I don't want to do it now so let's come back with this idea of the arc length and let's redo this a little more generally exactly the same so I have some graph y equals f of x and it goes from here A to here B I want to find its length I want to find the length of the graph from x equals x well it's exactly the same process from here to here so I do the same trick I chop it up into a bunch of little segments add up the length of each of those little segments if I have a little segment with dx then the height of that triangle will be dy and so the length of that little segment will be the square root of dy squared plus dx squared which because it's the graph of y equals f of x then that means that dy is f prime of x dx or if you prefer we also know we can rewrite this all in terms of dx factor the dx out so that means that dy squared plus dx squared which is a bit underneath the square root is going to be dy is f prime of x dx so this is f prime of x dx squared plus that dx squared that I had before so I can factor out the dx and so the length of the little bit that I want to integrate is the square root of that 4 is getting worse plus f prime of x quantity squared dx squared and the radical is dx so that's not in the right so that means that this is the little thing that I want to add up those are those this part the part that goes from one piece of the curve the curve runs away and then comes back to the next piece these little lines are that long so the length of the curve is the integral from where I start to where I end the square root of 1 plus dx that's the integral that I want to do this is the square this is the arc length of 1 plus the derivative of squared and it just comes from looking at this picture and thinking how long is the hypotenuse of the triangle to the leg of dx and because of the leg is dy so this is not hard the only problem with this is almost always these integrals really suck they're really hard to do in fact most of them you can't do directly you have to do numerically because square roots are awful and when you put a 1 in there it makes it worse so about the only one that works is like a function derivative is the tangent or something I mean there are very few examples where these things come out to be nice integrals there's still integrals and they still represent something but you have to do them numerically almost always few times there are few examples that work out that's one of them and let me do one that doesn't work out so this is a little bit easier this is really easy to write down the integral but then the integral is not really easy to do so here we have to find so f prime of x is 2e to the 2x that's easy because my graph is y equal to e to the x here it is I wanted to go from 0 to 2 I want the piece of this curve and so the length and just for notational well ok let me just point this out sometimes this differential here this is called ds sometimes you might encounter like in a physics class or something like that they ask you to integrate something ds almost always people use just like usually these x to represent the horizontal coordinate and y for the vertical coordinate typically people use s for arc length coordinate and so in a number of applications like in physics and so on you want to have something describe in terms of arc length and so often they will use ds to represent the arc length usually this length of a curve is called arc length inside there so the arc length here is just this integral I want to go from where I start to where I am square root of 1 plus the derivative square for e to the 4x dx now I can't do anything with that integral well actually I can if I let u be 1 plus 4e to the 4x what should maybe I can do with dx so no I can't do this square root of e to the u over u so this is one now if you want to know this number you can use simpson's rule or something like that let me do one that does work out I guess so there's like three that work out this is one but I don't like it and let's go from I don't know 0 to pi over 4 give me some curve and it has the nice property let's call it f of x that f prime of x is 1 over the secant times the derivative of the secant which is just the tangent and so that means that the arc length here is the integral from 0 to pi over 4 and what? the square root okay this is a good start 1 plus tangent square dx well that's what I can do 1 plus tangent square is the secant square and the square root is the secant the integral of the secant is the log of the secant plus the tangent I want to evaluate it from 0 to pi over 4 okay pi over 4 is 1 over the cosine of pi over 4 the cosine of pi over 4 is 1 over root 2 so this is the log of root 2 the secant of pi over 4 is root 2 tangent of pi over 4 is 1 minus the log secant of 0 is 1 tangent of 0 is 0 log 1 is 0 so this is the log of 1 plus the square root of 2 so it's enough it's enough log 2 it's a little bit a little bit less than the log 2 the other example that works is x to the 2.3 power so let me point out that sometimes sometimes these curves are easier to do integrating dy remember the formula is dy squared plus the x squared sometimes it's easier to lay on your side and find dy after that not to do that example so arc length is really easy but a lot of students the idea of arc length I think is very easy this formula makes perfect sense if you think about it just draw the picture most of the stuff in this class if you just think about it in the right way it's pretty easy but the integrals are generally horrible but okay some viewers can do integrals pretty well yeah this one can be done not by me so what is it can you do it can I say that oh yeah okay we did too much of this jump already so I'm happy because there's like blah blah blah so I can ask my computer to do these things a lot better than I can do it so computers are really good at this jump I have to show you how to do it so you can get some sense of what works and what doesn't work almost nobody actually does integrals by hand you have to understand how they work so that you can set them up but very few people that account for this class actually do nasty integrals like this you get a nasty integral like this you ask your computer it tells you yeah that's the answer or it tells you I don't know and then you say okay tell me numerically and it gives you give me it to so I'm gonna so any questions are everybody's good with it does everyone feel confident that no matter what function I give you you can set up an integral not necessarily do the integral but set up an integral to calculate anybody unconfident so the unconfident people most of the people in these empty seats here are people who said I have an exam last night you can't get up from that okay so let me move on so our quick is easy so let's move to the next topic this is also easy so it may seem like I'm going fast but it's easy so we should go fast when we can because we're behind so the next idea suppose suppose I have 10 numbers 3 5 7 18 these are people's grades on the midterm and I want to average them what do I do should I be more generous 30 150 170 these are 4 people's grades on the midterm what is their average what do I do to find their average and I divide by however many I have so this is 30 plus 150 plus 170 plus 180 over 4 okay suppose instead of having 4 grades I have 400 grades that I want to average what do I do I add them all up and I divide by 400 suppose that instead of 400 I want to compute the GPAs from all students at Stony Brook what do I do I add up all their grades and I divide by however many grades I have I divide now by well typically people get say 5 grades a semester there's roughly 20,000 Stony Brook students so I add them all up and I divide by 100,000 okay suppose I have some function that describes to me all the grades and it's not a bell curve because no so here is all the grades some people low, some people high and I want to average it what do I do and I divide by how many I have so the average is however many I have times some of all values this should start to look like something else you know I have a bunch of stuff and I divide by how many well other than the dividing by how many stuff I have what is this it's an integral if the number of things I have becomes very large so large that we'll call it infinite and it makes sense of the notion of the average value of infinitely many things or the average value of a function if I give you some range of values that the function takes on and I want to figure out the typical value or the average value well let's just do it in terms of a picture for a minute here's my function it's a line it starts here it goes here and I want to figure out what's the average value of all the numbers in between well geometrically this is pretty easy I can cut this in the middle so this is so the average value is just the area divided by the width find the area under the curve and divide by its width that would give me this is the same I should have brought a color as if I take a rectangle of the average height in other words if I take this piece and I cut it off and I flop it down there right here where the average is achieved people follow this looking really good so the average is just the area it's the integral divide by its width this is just the exact generalization of that add up infinitely many little heights divide by how many little heights you have exactly the same thing why is this useful well this is very useful in things like probability probability you want to talk about the mean where you sample a continuous distribution the mean is just the way of saying the average calculate the mean of something that's continuous you just integrate over the range of possible values you divide by how wide that is in a lot of applications you want to average some function this is very straightforward you just find the area you divide by the width that gives you the average in terms of genetically what we're talking about another way to say it we look at the graph from there to there I want to find a rectangle who has the same area as this at the same base so I'm going to cut some off the top and fill in the valley so I'm just going to take a big bolt over imagine this is a mountain and this is the hillside because I'm going to build a shopping mall there so I just cut this off and throw it down in the hole it's not enough so I cut this off and I just smooth this out here and so this is my average value this height there's as much stuff above as there is stuff below it's just the idea of I cut the top off and I fill in the valley and I make the rectangle of that height the rectangle of the height the same width is the average value that means it's exactly this idea now you need to see an example of this I mean it just seems so obvious that it's already been mentioned but so one fact that is useful in several applications is this mean value theorem so it's mathematically useful it says that if I have a nice function that goes from here to there there's always a point that takes on the average value this mean value theorem mean in the sense of average not even in the sense of not nice it says that if I have a continuous function it's like a nice curve in between so there's some c there's a c with c between a and b so that the value of the function is the same as the average value isn't true if my function isn't continuous if I have a jump then this isn't true because I suppose I have a function that looks like this and then it jumps down here while the area under this the average value is here there's no c that takes on this height because it's always this high or that high the function is always 10 and 0 there's no value that takes on the 5 so this is false but if your function is continuous then everything's free and here's the right idea why don't we stop here thank you for being in class I'll be back we'll get your exam back in recitation next week so Monday Tuesday or Wednesday raise your post as soon as I happen we'll see you sometime in a year