[MUSIC] Suppose I've got some function given by a rule and I want to make a graph of that function. I wanted to plot say this function f(x) equals 2x cubed minus 3x squared minus 12. First thing I might do is just plug in some values. All right I'll pick. Pick some inputs and I'll see what the function outputs at those inputs. And once I've got this table of values, I could then plot those points on a graph. The issue is, how do I really know what happens between these points that I plotted on the graph? How do I know the graph isn't doing some crazy wiggling in between? How do I know that I've really picked enough input points to really get a good idea of what this graph is doing? We're going to use derivatives to make sure that we're really capturing the qualitative features of the function. I might have been trying to graph a function, like f(x) equals sin Pi x, and if I just plugged in some whole number inputs, the function would always output 0. That might trick me into making a graph like this, where I plot 0 as the output for all these whole number inputs. I might, then, be tempted to just fill in this graph by drawing a straight line across. But that's totally ridiculous, right? This graph, you know, actually looks like this. Not a horizontal straight line. There's all kinds of extra wiggling that's happening that I missed because I chose my in points badly. We're going to use derivatives to make sure that we're really capturing the qualitative features of the function and there's a ton of different ways to do this. So let's work this out in one specific concrete example. So let's keep working on the graph of this function, f(x) equals 2x cubed minus 3x squared minus 12x. First thing I'm going to do is differentiate this, the derivative is 6x^2-6x-12, cause' the derivative of 2x^3 is 6x^2, the derivative of minus 3x^2 is minus 6x, and the derivative of minus 12x is minus 12. There's a common factor of 6 here which I can pull out, and then I'm left with this quadratic, and I can factor that quadratic into (x+1) times (x-2). Now once I've got this nice factorized version of the derivative, I can then figure out where the derivative is positive and negative. The derivative is positive when the input is more negative than minus and it's positive when the input is more positive than 2. In between -1 and 2, the derivative is negative. And at the point -1, and at the point 2, the derivative is equal to zero. Now, since this function is differentiable everywhere, the only critical points are where the derivative is equal to zero. These are the critical points, minus 1 and 2. Alright. So I found the critical points. I found the derivative. Now, I'll also find the second derivative of this function. Which I get by differentiating this derivative. If I differentiate 6x^2 I get 12x, if I differentiate minus 6x I get minus 6, and if I differentiate minus 12 I get zero. Again, I've got a common factor of six so I'll pull that out and I'm left with 2x-1. And now I can think about the SIGN of the second derivative. And what do I know about that? Well, the second derivative is negative if I plug in an x value which is less than 1/2 and the second derivative is positive if I plug in an x value which is bigger than 1/2. All right, now I know a lot of information about the SIGN of the first and the second derivative, so I can use this information to say something about the function. Let me look back to my preliminary graph that I made with just plugging in a few points. All right, so here I plugged in a few points and what I'd like to be able to say now is where is the function increasing and decreasing. And by looking at the sign of the first derivative I know that the function's increasing, decreasing, and then increasing. Minus 1 and 2 are my critical point and in fact, they're local extrema. This is a local maximum value, and this is a local minimum value down here, and I can also see that by considering the information given in the sine of the second derivative. Since the second derivative's negative here, the functions concave down. And since the second derivative is positive over here, the function is concave up. And that makes this point into a local maximum and this point into a local minimum. Alright, now that I've got all that information I can try to just fix the graph here filling it in. So let's see, so I've got these points here and what do I know? I know the function is increasing here, and now I know that it's decreasing here. And I know that it's concaved down in this region. Over the rest of the graph the rest concave up. There's an inflection point here when x=1/2 and this point over here is a local minumum. The function's decreasing by looking at the sign of the first derivative, until I get to two. And then when I get to two, the first derivative tells me the function's increasing. So there we go, I've drawn a graph of my function. The point here is not to capture a perfect picture of the function. It's like an impressionistic painting, the point is to capture all of the meaning all of the emotion of the function. Compare that to a photograph which might be a perfectly accurate portrayal, but somehow misses everything that's essential. So here's the graph that I drew in red, and here is a more perfect graph admittedly, that the soulless robot drew. And you'll see that my graph really is just as good. I mean, it captures all the qualitative information which is really what a human being cares about. Functions increasing, decreasing, increasing. You can see where it's concave down and where it's concave up. And you can kind of see roughly where this function crosses the x axis. Let's summarize the situation. There's really 4 basic pieces that you're just gluing together when you're doing a lot of these curve sketching problems. It depends on the SIGN of the first derivative, and the SIGN of the second derivative. If the derivative is positive, and the second derivative is positive, then the function is increasing, and the slopes of the tangent lines are increasing. If the function's derivative is negative but the second derivative is positive, that means although the function's decreasing, the slopes of those tangent lines are increasing. We've got kind of complementary pictures over here when the second derivative's negative, here the function's increasing but the slopes of those tangent lines are decreasing, and here both the function is decreasing and the slopes of the tangent lines are decreasing. A lot of the curve sketching problems amount to just gluing together these four basic pieces in the appropriate way.