Welcome to Calculus. I'm Professor Ghrist. We're about to begin Lecture 39 on Averages. What's an average? An average is something that's in the middle. That doesn't sound very mathematical, but that intuition will help you as we consider what it means to take the average of a function. Averages are both ubiquitous and intuitive. If someone were to ask, say, what is the average unemployment rate. Well, you might get out the graph and eyeball it. Try to pick a number that's sort of in the middle. That's the way it feels like it ought to be. Odd, of course, an average depends on a couple of factors. First of all, it depends on the interval over which you are looking. If in the case of unemployment you change your time interval, then you might have very, very different result. And in fact, the function that you are trying to average might look very, very different and as the variation of that function increases it becomes harder to see. What we actually mean when we say average, and so, we need a definition. Now, our intuition says that the average of a function f over an interval from a to b. Should be the constant value where the area above and the area below balance out or are equal. Let's say about there. We would denote that average by the symbol f bar, the bar over the top meaning the average. We can write out an integral form for this intuitive definition, namely that the integral as x, goes from a to b of f minus f bar dx equals 0. Now, let us solve this equation for f bar. Integration is linear, so we can move the integral of f bar over to the right-hand side. But, by definition, f bar is supposed to be a constant, just a number, so we can pull it outside the integral. And now, solving for f bar, we get the integral of f dx over the integral of dx, both integrals running from a to b. Now, you've probably seen what comes next. Anyway, we evaluate the denominator to be x evaluated from a to b, that is b minus a. And so, one typically writes f bar equal to 1 over b minus a times the integral from a to b of f dx. That is a great definition. It's fine, but it's not optimal. The better definition is in terms, the ratio, the integral of f, to the integral of 1. And why is this so much better? Well, instead of your integration domain being the interval from a to b, we could consider an arbitrary integration domain, d. And still have a nice definition for the average fr. For example, if D is a discrete set and your f is really just a sequence of values, like say test scores, then you know, the classical formula for the average. In this case, it's the sum of these f values divided by n, the number of scored, but of course we could rewire it that as the sum of the f values divided by the sum of 1. As you're going from 1 to n that's giving you your denominator, and this really fits into the same category of definition since a sum is really just an integral for a discrete set. Now, let's look at a few examples. Let's compute the average over the integral from zero to T of three classical functions monomials, exponentials, and logarithms. For the monomial, for x to the n, what we have to do is integrate x to the n dx from 0 to t, and then divide by T. This is simple, you can really do it in your head. What do you get? You get T to the n. That is, the function evaluated at the right-hand endpoint divided by n plus 1. That's the average value of x to the n over this interval. What about the exponential, e to the x goes beyond polynomial growth. Well, this too is an integral that we can do in our head, but notice what you get. You get the right-hand endpoint, e to the T minus 1 divided not by any n but by T. So it's as if the all the growth that happens in the exponential function happens right at the end. Now, lastly, for the logarithm, we're going to have to change our lower integration value to 1 rather than 0. But notice what happens when we integrate log of x. We get x log x minus x through integration-like parts if you like, when we evaluate this. We see that the average value for a log of x on the interval from 1 to T is exactly log of T minus a little bit. This is again, telling you how slowly log of x grows it's average value is almost equal to the right-hand endpoint. That's pretty cool. Let's do another example. What is the density of the earth? Well, by which I mean the average density, since it changes. Recall, we know a little something about the volumetric density function. Rho is a function of r radial distance. Now, you might be tempted to look at this graph and, and try to eyeball it, and figure out the average density there. But, be careful, we have to use this integral formulation rho r is not the integral of rho of r dr over the integral of dr. That is not what it is, because of course, rho is a volumetric density. And so, our integration must be done with respect to the volume form, rho bar is integral of rho dV over the integral of 1 time dV. Now, rho dV as we recall is really just the mass element, and so, in retrospect, it's really kind of obvious that what we would do to compute the average density is compute the mass, the integral of dM, over the volume, the integral of dV. And you can write that out more explicitly if you wish. Let's turn to another example. This time involving blood flow through a tubular vessel. There is something called Poiseuille's Law that tells you how the velocity of the fluid varies with respect to location in the cylindrical vessel. If we look at a cross section that is going to be a disc of radius capital R. There's some maximum velocity, but the velocity is going to be a function of the radial distance, little r. This is going to be a quadratic function, Poiseuille's Law says that the velocity, V, is a function of radial distance of R is P over 4 mu l times quantity big R squared minus little r squared. In this case, P is a pressure, mu is a viscosity, l is the length of the vessel, but don't worry about all that stuff, it's just constants in this case. What we are going to worry about is the average velocity, vr. Now, in this case, what do we integrate with respect to? It's got to be with respect to the area element, since we're taking a cross sectional area. v bar is the integral of vdA over the integral of dA. In this case, dA is an annular strip with constant little r. That is 2 pi rdr. Now, plugging in our formula for V, what do we get? Well, first of all, the denominator gives us a pi r squared, and that, we know. And so, what we have left is the numerator. That is the integral. As little r goes from 0 to big R of this constant P over 4 mu l times quantity big R squared minus little r squared times the area element 2 pi rdr. And we can simplify that integral quite a bit pulling out p over 4 mu l constant, canceling the pi's, pulling the two outside. And then, what do we have left? some big constant times a simple integral.. We have to integrate big R squared times little rdr. That gives big R squared, the little r squared over 2, and then we have to subtract off the integral of little r cubed. That's little r to the fourth over 4. Evaluate from 0 to big R and what do we get? Well, we get something that looks a little complicated at first, but is not so bad. Some of the big Rs, and the coefficients cancel, and we're left with P over mu l times big R squared over 2. If we consider our initial velocity profile, we see that this is really just 1 half times the maximal velocity at the center of the tube. That's a nice result. For our last example consider what happens when you plug something into the wall with alternating currents, the voltage is going to be sinusoidal. The voltage is a function of time is going to be some constant, Vp times sine omega t. This constant, Vp, is the amplitude or peak voltage. Omega is giving you some sort of frequency of oscillation. The period is going to be defined as 2 pi over omega. Now, the question is what is the average voltage. Well, the problem is over every period if we compute the average. We wind up integrating a sine function over an entire period from 0 to 2 pi, as it were, I'll let you do the computation to see that the average voltage is 0. That is totally useless for our purposes. So, what we do is define a different type of average. This is called the root mean square in some circles. Sometimes, it's called the quadratic mean. The root mean square, it is defined as follows. Square your function, f, take the average of the square and then take the square root of that. So, this square root, the average of the square will give us something that is non-zero, because that squaring makes all of the negative terms positive. In the case that we looked at before, the root mean square voltage, V RMS is what? We square the voltage, Vp squared times sin squared omega t. Then we average that, taking the integral from 0 to 2 pi over omega, and dividing by that length, 2 pi over omega then square rooting. Now, this integral is not so bad, we can use the double angle formula and take advantage of the fact that we're integrating of a full period so that that cosine term integrates to 0. Then, we're left with the square root of omega over 2 pi times Vp squared times 1 half t as t goes from 0 to 2pi over omega. Well, that evaluates simply enough, and wonderful to say, cancels the period, and we're left with Vp over the square root of 2. Now, in practice that works out to about 71% of the peak voltage. That's what the route mean square is. So if you see something that is labeled at a 120 volts, what you're really getting is that root mean square voltage. The peak voltage is actually bigger at almost 170 volts. This lesson should lead you to wonder what other kinds of things can be averaged. Can you average locations or points on a map? What happens when birds fly in a flock? They seem to do so with a great deal of coordination. What they are often doing is simply averaging the orientations or the directions of their neighbors? Fish do similar things. What other kinds of things can be averaged? Can we average things like faces? Can we take a collection of human faces and compute an average? In what way would that be like an integral? These are all excellent questions that with enough mathematics, you can answer. We now know how to average a function over a domain and we've seen hints that there are more interesting types of averages out there. In our next lesson, we'll look at what it means to average a collection of locations or positions. Some of the integrals involved are going to be a bit intricate. You might want to take a look at the Lecture 31 Bonus Material before beginning. [BLANK_AUDIO]