In today's video, we state the second derivative test which makes explicit the technique we've already been using in developing our skills in curve sketching. This test enables us to infer from the sign of the second derivative whether certain points on a curve correspond to a maximum or minimum. Suppose we have a function f with a rule y equals of fx, such that everything is well-behaved and in some particular input x equals c. By well-behaved we mean, generally, that the curves at least continuous that is can be drawn without lifting the pen off the page. We assume that the curve is smooth enough that the first and second derivatives exists at all points of interest. The test comes in two parts. The first part asserts that if the derivative of f evaluated at x equals c is zero, and the second derivative is positive at that point, then the value f of c is a local minimum and it might even be global although we can't be sure. The second part asserts that if, again, the derivative is zero, but now the second derivative is negative, then the value f of c is a local maximum and might possibly be global. Both of these correspond to facts about curves that are probably now becoming quite familiar to you. In the first case, the curve is concave up or bowl-shaped up. Now I'm used to using a smiley face symbol and the apex clearly suggests a minimum. In the second case, the curve is concave down or bowl-shaped down, and again, we're used to using a sad face symbol and the apex clearly suggests a maximum. For example, the shape and behavior of parabolas fit nicely with the second derivative test. Consider any quadratic function y equals ax squared plus bx plus c, where a, b, and c are constants, such that a is non-zero. Then, the derivative is 2ax plus b, so the second derivative is the constant 2a. If a is positive, then the second derivative, which is twice a positive number is positive, so the test predicts that the turning point should be a minimum. So that the associated parabola must be facing upwards, which matches exactly what we expect from a quadratic with a coefficient of x squared is positive. By contrast, if a is negative, then the second derivative is also negative. So, the test predicts that the turning point should be a maximum. So that the associated parabola must be facing downwards which, again, matches exactly what we expect from a quadratic with a coefficient of x squared now is negative. Now, let's use this test to determine extrema, if any, for two curves. Firstly, y equals x e to the x, and secondly y equals xe to the minus x. Consider y equals xe to the x. By the product rule, its derivative is easily seen to be e to the x plus x e to the x, which factorizes as 1 plus x times e to the x. Observe that y dash is zero precisely when x equals minus one because e to the x is always positive. Applying the product rule again, the second derivative becomes e to the x plus 1 plus x times e to the x, which factorizes as 2 plus x times e to the x. If we evaluate the second derivative x equals minus one, we get one over e which is positive. All of the conditions of the first part of the second derivative test are satisfied, so a minimum occurs when x equals minus one, and that minimum value of y turns out to be negative one on e. Notice that we have mechanically followed the recipes specified by the first part of the test without even thinking about what the associated curve could look like. The treatment of the second curve is similar. We differentiate and factorize the derivative and see that if it becomes zero precisely when x equals one. We differentiate again and evaluate the second derivative at x equals one, where the first derivative is zero to obtain negative one on e, which is negative. Now, all of the conditions of the second part of the test is satisfied, so a maximum occurs when x equals one, and that maximum value of y turns out to be one over e. Again, the process was followed mechanically but it's always good practice if you can to try to visualize the underlying curve and relationships. Here are the first and second derivatives of the function y equals x times e to the minus x and we can build their corresponding sign diagrams. First, y dash confirming indeed that there is a maximum occurring at x equals one, and even more the maximum must be global due to the pattern increasing followed by decreasing. Then, for y double dash, noting that x equals one indeed falls within the region where the curve is concave down and we get the extra information about the concavity and the existence of an inflection when x equals two. These are both natural steps in the process of curve sketching. Notice that the y and x intercepts are above zero so the curve passes through the origin. The other usual ingredient is to look for asymptotic behavior. It's clear that as x gets large and negative, then x times e to the minus x explodes negatively. What's not clear is the behavior of xe to the minus x as x gets large and positive. The expression can be rewritten as the fraction x divided by e to the x, and both the numerator and denominator are getting arbitrarily large and positive, and it's not obvious what happens to the fraction of one large number divided by another large number. There's a sophisticated tool from advanced calculus like a supercool Maserati of limit laws that enables us to transform this limit into something simpler. It's advanced trick is called L'Hopital's Rule. Often called the hospital rule by students at a so good of fixing things and named after 17th century French mathematician Guillaume de L'Hopital. If you take on more advanced courses in calculus, you'll become quite familiar with this rule, but it takes some care. Under certain conditions, it says you can differentiate the top and bottom of a fraction and you get the same limit. It turns out to be applicable in other situation though I don't want to get into the details of why. We can differentiate x in the numerator to get one, and e to the x in the denominator to get e to the x back again and we now get a much simpler limit. In fact, the usual limit associated with exponential decay which is zero. The upshot of all this is the limit as x goes to infinity of x times e to the minus x is zero, so that the positive x-axis becomes a horizontal asymptote for the curve. Putting all this together produces a sketch of the curve, with all the important features that we've noted before. What about the curve from part (a) of our earlier problem? We can in fact get the sketch by playing around with reflections in the plane applied to the curve, we've just looked at in detail. First, we're reflecting the vertical y-axis to get the following diagram. Algebraically, this corresponds to replacing x with minus x in the rule for the function, which quickly simplifies to minus x times e to the x. Thus the curve y equals x times e to the minus x is transformed into the curve, y equals minus x times e to the x. Now, we take this transformed curve and reflect in the x-axis to obtain the following diagram. Algebraically, this corresponds to taking the negative of the y-values, which quickly becomes xe to the x. This in fact produces the rule for the curve for part (a) of our original problem. Then all of the corresponding features such as the turning point, the inflection, and also the negative x-axis as a horizontal asymptote become apparent. Notice also how the two curves can be obtained from one another by rotating 180 degrees about the origin. It's a general fact important in geometry and algebra, that if you follow any reflection by another refection, the overall effect is a rotation. If we create a transparency of the original curve and flip it over vertically, and then horizontally, we see the overall effect of a rotation. But we can perform any other pair of reflections, and the overall effect is always a rotation. You can also see this effect with a coin. You flip it over twice, any odd how, you get a rotation from the original position. I'd like to finish by remarking about relationships between pairs of functions, as this leads naturally into the theory of differential equations, which you're likely to see in any further courses on calculus. The simplest examples that give rise to exponential growth and decay, y equals e to the x and e to the minus x form a natural pair. They turn out to be what are called fundamental solutions of the differential equation, y double dash minus y equals zero. You start with either of them, differentiate twice and take away what you started with, you get zero. This equation is called differential because it involves some kind of derivative, in this case, y double dash. The two functions are called fundamental solutions because they're basic building blocks and turn out to be fundamentally different in the sense that it can be made precise in advanced mathematics. You could think of them as analogous to hydrogen and helium atoms in chemistry. Another natural pair are the circular functions y equals sin x and y equals cos x. If you start with either of them, differentiate twice and add what you started with you get zero. This solution to the equation y double dash plus y equals zero. Even though you might think of circular functions is completely different from exponential functions, there's a strong connection from the point of view of differential equations. To get from one pair to the other, you just alter the associated differential equation by turning a minus into a plus. We can also pair y equals e to the x with y equals xe to the x, one of the curves we started in this video, which you can think of is like a modified form of exponential growth. They turn out to be a solution to the equation y double dash minus 2y dash plus y equals zero, as you can check easily if you wish. If you pair y equals e to the minus x with y equals xe to the minus x, some kind of modified form of exponential decay, you get solutions of the same equation as the previous pair but with minus replaced by plus. What if we put a pair of pairs together? Say e to the x, e to the minus x, sin x, and cos x. This turn out to be fundamental solutions to the equation y with four dashes, the fourth derivative, minus y equals zero. What if we go the whole hog and add to this list the two curves we studied today, y equals xe to the x and xe to the minus x. These turn out to be fundamental solutions to the equation y with six dashes, minus y with four dashes, minus y double dash, plus y equals zero. You can easily check these are indeed solutions, but you might wonder how on earth could one come up with a single unifying equation like this. There are indeed methods a bit like magic tricks that you'll learn if you go on to study more advanced courses on calculus and linear algebra. There are so many intriguing possibilities and surprising connections. Many people devote their lives trying to discover and understand solutions to differential equations, working out how they fit together and relate to one another. They're like organic chemists, discovering new and revolutionary organic compounds or genetic engineers seeking ways to splice together genes to cure or prevent diseases. I hope this very brief introduction might stimulate your interest to learn more about this fascinating topic, drawing upon connections between many different branches of mathematics with myriad applications to science and other disciplines. This module is finally drawing to a close. The key idea or focus throughout has being the derivative and the careful development of techniques of differentiation. We started increasing and decreasing functions, saw how to recognize this behavior using the first derivative where being positive corresponds to increasing and negative to decreasing. So, the transition from one to the other indicates the presence of a turning point, where the value of the function achieves a maximum or minimum. All of this is captured concisely using the sine diagram for the derivative. We studied concavity of curves, where concave up or bowl-shaped up behavior is indicated by a positive second derivative, and concave down or bowl-shaped down behavior is indicated by a negative second derivative and transition from one to the other indicates presence to the point of inflection. All of this is captured concisely using the sign diagram for the second derivative. We adopted useful mnemonic devices or symbols involving a smiley face for concave up and a sad face for concave down. We developed thorough and systematic protocols for curve sketching including; intercepts of the axes, horizontal, vertical, and oblique asymptotes and all of the information captured by the sign diagrams for the derivative and second derivative. We introduced and applied several rules for differentiation including the Chain Rule associated with composition functions, the Product Rule associated with multiplication, and the Quotient Rule associated with division. We looked at some contrasting examples of optimization, where the task is to find out where values of a function might be minimized or maximized, and just now looked to the useful criteria involving the second derivative called the second derivative test. Please read the notes and when you're ready, please attempt the exercises. Thank you very much for watching and I look forward to seeing you again soon in the final module, where we launch into the integral calculus.