Are welcome to our lecture on how derivatives affect the shape of a graph. I thought we could start this with a little bit of a warm up. So on the screen is a picture of a graph and what I want you to do is to find the critical points, find the critical point. So if you forgot the definition of a critical point, pause the video and go look that up for. So remember, critical point has two parts to it. We're looking for where the derivative does not exist or where the derivative is 0. So on the graph, I don't have any numbers labeled on the graph, so just kind of point to things and figure it out. So let's look at this for a second. So on my graph, I have a nice smooth maximum at my first point, I'll just label 1 for now. But if you got this point right here where the tangent line is flat or the slope of the tangent line is 0, then you caught the only value on the graph where the derivative is in fact 0. So we're looking for like local maxes and local mins. Remember though, the other condition is where the derivative does not exist. Where are their values where the derivative doesn't exist? On this graph, I drew two cusps as well, so we'll call those points 2 and 3 for no good reason. But there are also two costs, these are sharp corners. If you're running your hand over it, it kind of hurts a little bit, there are two values there. So on this particular graph there are two of them as well. So if we were labeling the critical points, remember are the x values, so we'd say x is 1, 2, and 3, okay? So now, after you find the critical points, that's usually sort of part a, part b is to classify them as a max or a min, a local max or a local min. So let's start off with local. So local means in an interval around them, would they be a local max or min? So with x = 1, we have a nice local max, it's a little top of the hill there, very nice. At x = 2, now you're the bottom of valley. It's still a valley, it's got a little sharp cuss there, but that's okay, so that's a local min, no problem there. And then x = 3, it is also a little bit of a local max, it's the largest point. Now, it's not differential there because of the cuss, it's the largest point, but it's still a local max. Now, this particular example is going to lead us to our next observation. If you notice, if I look a little bit so the left of my local max and I pick a point and I tried to draw a little tangent line, it has positive slope. And if I pick a point to the right, it has negative slope, the tangent line does. And if you keep sort of doing this, if you look a little bit to the left and a little bit the right, you can ask yourself what is the derivative doing at these values? So to be a local maximums I have to increase and then decrease, to be local men means I have to decrease and then increase. So I go up and I go down, I go down and I go up, that sort of behavior of the function can be captured by the derivative. That test is called the first derivative test and it comes from the mean value theorem. So first, this is going to give you stuff out the derivative, let's put our conditions in there. Let f(x) be a differentiable function with critical number, c. And our first observation is as follows, if f'(x), the derivative changes from positive to negative at x = c, then f(c) is a local max. Similarly, if f'(x) changes from negative to positive at x = c, f(c) is a local min, so the derivative is telling us information about the function. Last but not least, it's possible that there are some critical points where the derivative does not change. So let's capture that last case, if the derivative does not change its sign at x = c, then c is neither a local min nor local max. Those are three cases. Okay, so here's our first derivative test. Let's use this to classify critical points as max, local max's, local mins, or neither, so let's do an example here. Okay, so take the function f(x) = 2x cubed- 3x squared- 12x +2. We're going to use the first derivative test and classify the critical points as local mins, local max, or neither. So first step, always take a derivative. When we take a derivative, we get 6x squared- 6x- 12, we know this is a polynomial. We know this is defined for all real numbers, so the only critical values are found, so cp, find the critical values when I set the derivative equal to 0. When you do So that you can factor a six out and you're left with x squared minus x, minus two is zero, divide both sides by six. In fact, are you get x plus one x, minus two is zero. That gives us two critical values, x equals minus one and two. These are my critical numbers. I would like to know however, are these local maxes or local mins? So we're going to use the first derivative test. When we use the first derivative test, it's kind of helpful to make what's called a sign chart or sign graph. This helps us keep track of all our information in one pretty little picture, so we draw a number line and we plot negative one and two on the graph. And remember we're interested in the behavior of the derivative a little bit before and a little bit after. So what we're going to do is we pick test points a little bit before and a little bit after we try to pick some easy test points. We don't work too hard to find their value, so how about a little bit to the left to negative one, we pick negative two and a little bit to the right of one. Well, the easiest number I can think of is zero. So number line not drawn to scale here and then a little bit to the right of two how about we pick three, so those will be our test points. That sort of surround the critical points that we have. And now what we're looking for, we go off on the side and you test the test points. So you say OK, what is the derivative doing in minus two when I plug minus two into the derivative? You can check you get 24, but the value itself is not as important as the fact that it's positive, so we do is we put a big plus. Then that captures all the values for if we picked any test point they left, the negative one we've got positive, so we put a plus. That's why it's called like a sine graph like sign is positive. If we pick zero, this is easy to see if you take zero and plug it into the derivative, you get minus 12, which is of course negative. So over the interval between negative one and two we have a minus sign with this means that it's negative, the value the number that the function is getting the derivative is giving me does not matter. Take your last test point three. Then I go off and I plug it in, I get 24 again, which is positive. So just grabbing the sign tells me is positive. So now relate the derivative to the function. If the derivative is positive, we're going to put underneath here so you can see how it relates. We saw this last time by the mean value theorem, the first derivative test tells you the function is increasing, so usually drawn arrow up. When the first derivative is negative, the function is decreasing and when the first derivative is positive, the functions increasing. So I have a function that is increasing, decreasing and then increasing again. This is telling me what the values are is a maximum. Think about if I increase and increase that, I just make you can do with your hand if you want. Then I make little mountain or done I make a little valley. So if I'm increasing and decreasing then I made like a little hill, so the function goes up and down. That tells you that x equals minus one is a local max. Similarly if I decrease and then increase, if I decrease and then increas and draw this if you want. If I decrease and increase I made a little valley. So now that tells me that x equals minus two is a local min. OK, so the first derivative is telling us the what they are local min or local max based on the sign, I never use the actual values from plugging in my test points. They are not really important. OK, so one to special note because the derivative function can only change sign at the critical numbers, the sign of the derivative remains the same throughout each interval determined by these test points. The test point you pick is completely arbitrary, so pick nice easy numbers. Don't pick like one over square root of two or some horrible number. That's going to be really difficult to find, let's do one more example, same thing. Finding critical numbers and classify them. So let's do f of x equals x cubed plus six, OK. First thing find the critical points. So let's take a derivative. When we do that, we get three x squared derivative. Six is constant that goes away and we set it equal to zero, three squares. A nice parabola, manal reels that are if it if is defined always. So if I take this instead equal to zero, the only critical point you get back is x equals zero, so that's step one. Take a derivative, find the critical points off Rex maybe call at step two. OK, now I want to classify so classify tell me is this point and local max local min, neither who knows and we do that using the first derivative test. And that basically is a fancy way to say draw the sine graph for the first derivative. OK, so I plot my critical .0 on the map and I want to look a little bit left and a little bit right and grab some. Ask points and see what's going on. I think the easiest number a little bit left is at -1, and the easiest number a little bit right is at +1. So you go off on the side and you do your scrap work, and you plug into the derivative your test points. What is the derivative at -1, and what is the derivative at 1? And you can check when you plug in -1 I guess pretty quick to see, you get 3 for both -1 and for +1, and they're both positive. So you come back to your sine graph and you put a positive inside on top of the number line. And remember the goal of all this is to relate the derivative to the function. So this tells me that the function is increasing before 0, and then increasing after 0, increasing after 0. So just to sort of see what this looks like just because it's relatively simple example, the function is going to sort of increase flat line for a minute, and then increase again. So right at x=0 where the value is 6, you have a nice horizontal line. However, It's not a not a change in sort of the increasing or decreasing. So x=6 it is a critical point, but because the sign of the derivative did not change, x=0 is not a local max, it is not a local min, it is neither, okay? So it is neither maximum. And this can happen, and so you're just looking for the derivative to change sign, +2 or minus, or- 2 or plus. If it stays the same sign, then the first privative tells us that it is neither a local max nor a local min. Now before we move on we're going to talk about concavity for a minute. So concavity is a statement about the first derivative, although most people interpreted about the 2nd. So we say that a function is concave up if the first derivative on some interval is increasing. Now because of the statement about the first derivative and increasing, it forces the graph to look a certain way. And so we talk about concavity when the graph at the informal way that everyone says, of course is if it holds water. You can think of it the classic example is y equals x squared. This parabola is concave up on its entire domain, because the derivative y=2x is always increasing. Starts off negative goes to 0 and goes positive. So concave up just gives you a general shape of the graph, and you can remember it holds water. And for similar reasons we say that a function is concave down, if the first derivative on some interval from a to b is decreasing. This informally means the graph will have such a shape that it spills water. And of course you can think of it as like maybe y equals minus x squared, in this case I lifted it so +2. So something like this, but it's really more of a statement about the derivative. What is doing, increasing or decreasing? So what is the general shape of the graph? So we want to now define, so one more definition for you. At inflection point, so we will let see inside this interval from a to b open be an inflection point of the function. If the function changes in concavity at x=c. So this is the key thing here, it has to change concavity. You have to go from holding water to spilling water. So maybe there's my point right there, so I hold water and then I spill water. Or the other way around, I spill water first and then I start to hold water. So I spill water and then I hold water. Wherever that change happens, the point where that change happens is called an inflection point. So we'd like sort of a recipe and approach to finding intervals in concavity, defining inflection points. It's going to feel very similar to what we just did, and it's all related via the mean value theorem. And here's sort of the relationship to the first derivative and the second derivative. So we say the function is concave up, if and only if the derivative is increasing, this is how we defined it. If the derivative is increasing function, but remember by the mean value theorem, a function is increasing if its derivative is positive. So what is the derivative of the first derivative? The second derivative is positive. So this relationship, right? The more derivatives you know, the more you know about the function or the things that are missing. And similarly the function is concave down. The graph will look like it's spilling water, if and only if the first derivative is decreasing. But that's if and only if the second derivative is negative. So this relationship, one of them is the definition one comes from mean value theorem that they all kind of get lumped together. And that But this still allows us to find what's called the second derivative test, and this is going to be our recipe for this, when you connect the first and the second ones together, okay? So let's do an example. Let's make it official and give it a slide that it deserves. So, the second derivative test is going to say for some function that's differentiable. It's going to say that, this is sort of reading that last graph from right to left. We have that a function is concave up, if and only if, the second derivative is positive. And similarly a function is concave down, if and only if, its second derivative is negative. These two statements, I should say, are the standard algebraic approach to studying concavity. It's going to give us a way to find intervals where the graph is concave up or concave down. And then once you have these intervals, we can go off and find inflection points. So let's do an example and do this, instead of talking about abstract theory and put some numbers behind it. So, let's take a function f(x)=x to the 4th minus 2x cubed minus 12x squared plus 5, okay? Now, what I want to do here is start to study the function, find where it's concave up and find where it's concave down, and then from that tell me any points of inflection. So to get concavity we need derivatives, we need the first derivative, we need the second derivative. Let's go find those now. So, the first derivative is 4x cubed minus 6x squared minus 24x. Its second derivative, the thing that's going to tell me information about intervals of concavity, then becomes 12x squared minus 12x minus 24. Now this is a polynomial is to find all real numbers, so the roots of this equation is going to tell us where the potential points of concavity lie. So, I want to set this thing equal to 0. When I do that, if you notice that I can factor out the 12 pretty quickly, you get x squared minus x minus 2 is 0. You can divide both sides by 12 and factor. You get (x+1)(x-2)=0. So you get x=-1,2. So, that is where potential places for changes in concavity can occur. So how do we find this thing? Again, we draw our sine graph just like we did before, but now since we're studying the second derivative, let's label the top of the number line with f'' and we'll label the bottom of the number line with f'. Same thing as before, I want to know what happens in these intervals a little bit to the left, the interval in the middle, and the interval to the right. So let's pick some easy sample points to kind of plugin. How about we pick -2, 0, and 2. So you go off on the side. You do some scrap work, and you plug in to the second derivative, your test points. I want to know what is the second derivative of -2, and 0, and 3. The value these numbers output, I don't care, it's more about what their sign is. You can check when you plug it in for -2 you get 48 which is very positive. When you plug in 0, that one's easy to see, you get -24. That's very negative, and then you get 48 again, which is also positive. So, we put the +, the -, and the + above our number line on our sign graph for concavity. And then we remember what the second derivative test tells us. When the second derivatives positive, the function is concave up. When the second derivative is negative, the function is concave down. And when the second derivatives positive, the function is concave up. So, we now know which of these potential points here where x=-1 and x=-2, our inflection points. We need concavity to change. It doesn't matter if it goes from + to- or- to +, I just need it to change. So, since it happens at both x=-1 and 2, these are both inflection points. So, I have two inflection points. And then if I want the intervals of concavity, I can answer this here. So, where is it concave? Where's the function concave up? Well, that's at negative infinity to 1, and 2 to infinity. If you want to get fancy, if you know a little set theory, you can use the union symbol, if you want, instead of writing and. That's perfectly fine. If you want to write the interval where it's concave down, that's the middle interval between -1 and 2. When you write intervals of concavity, you tend to do open intervals because concavity happens over an interval, so it doesn't really make sense to say it happens at an endpoint. Notice I'm giving the x values for concavity, so whenever they ask, where is it? They always want the inputs, not the outputs. What are the x values here. So we have two inflection points at x = -1 and 2 because concavity is changing. I had to check that. I couldn't just assume because the second derivative is zero that I have inflection points, be careful. And then from there, I go off and test my test points, and I can tell you where it's concave up and concave down. If you graph this function, if you want to look at this function a little bit, it follows exactly what we expected. It has a general shape like that. We'll see how to do better sketches in the next one, the next video. But for now you can see that it does, in fact, follow what you expect. The inflection point or -1 is where it goes from holding water to spilling water. And then at 2, it sort of changes again to holding water and stays that way for all x larger than 2. One last thing just to mention as we study concavity and intervals of increasing and decreasing, this idea of concavity, it's important to understand the overall shape of a graph. And using concavity to explain how the derivative changes as inputs increase. The concavity can also, of course, tell us how to classify critical numbers. So it's used to classify inflection points or tell you when you have inflection points, but it's also used to tell you if you have a local min or max. And remember, if the second derivative at a critical point c is positive, what does that mean? That means that the function at c is concave up. So if you think of a little picture here, it holds my water. So at c, it's concave up. But that means that the critical point, because it's concave up and it's where the function has derivative equals 0, that implies that c is a local min. So you can start putting this altogether and using, sometimes they call this the second derivative test as well. It's just they all relate to each other and it's just key to understand how all these things behave. So same thing, if I have a critical point where the second drive is negative, then I know that f(c) is concave down. And that means that the graph kind of spills water, so I'm kind of at the top of a hill. It's a little counterintuitive, up is a local min, and if I'm concave down, c is a local max. You just have to be careful. The one warning, maybe I'll put in red so it's more obvious. If the second derivative is 0 at a critical point, then you don't know exactly what it is. You can't quite tell. You need to use the first derivative test, need first derivative test. Just be careful, you can have cases where both happens. And that can tell you if it's a local max, local min, or neither. In particular, neither can happen. So that's usually just be careful on true false is they say, true or false, if the second derivative at a critical point is 0, then you know it's a max, then you know it's a min. Then you know that, you don't. That's the thing, you have to check, okay? So we'll go do some more examples in some future videos, but start here. And yeah, good job with all this. Keep this down and lots of examples to let this all sink in. All right, see you next time.