In today's video, we discuss local and global maxima and minima, collectively called extrema for rules of functions, which are related to turning points of curves. We provide some contrasting examples and illustrate how to search for extrema by looking for the changing sign of the derivative to see where a function changes from being increasing to decreasing or from decreasing to increasing. We finish with the discussion of the closed interval method. Consider the rule y equals f of x to be the rule of function f. We say that f of a for some input x equals a. So, local maximum, if f of a is greater than or equal to f of x for all x near a. We say that f of a is a local minimum if f of a is less than or equal to f of x for all x nearby. We may refer to either a maximum or a minimum as an extremum, and if the previous properties hold for all x in the domain of the function, then the extremum is said to be global. Just think of a global property is one that holds everywhere. To be near a on the real number line means ranging over some interval surrounding a. That interval which could be quite small is often called a neighborhood of a by mathematicians. Extrema may not exist even for the simplest of functions. For example, any linear function, where the slab is non-zero increases and decreases smoothly and uniformly without bound. There's no opportunity for any value of such a function to be the greatest or the least in any neighborhood of its input. However, by contrast, any linear function with zero slope that is a constant function y equals k has only one value. So, that constant k becomes simultaneously both a global maximum and minimum value of the function. Consider now a function f, whose rule f of x is a quadratic. The graph is a parabola. Opening upwards if the coefficient of x squared is positive or downwards if it's negative. In the upwards facing case, the apex, also called the vertex of the parabola is the lowest point. When the parabola is situated somewhere in the xy plane, and one moves across to the vertical axis, we produce a y value which is less than or equal to all y values produced by the parabola. So, it becomes the global minimum. In this diagram, the apex is in the fourth quadrant, but it could be located in any quadrant. Wherever it is, when we move across to the y-axis, we always produce the global minimum. In the downward-facing case, the apex now is at the highest point. So, wherever the parabola is situated in the plane when we move across to the y-axis, we produce the global maximum. So, we have complete information in the two cases of quadratic functions. The apex, in either case, is also called a turning point. In both cases, the tangent line to the curve at the apex is horizontal, so has zero slope. These are special cases of a general phenomenon. A turning point for a general curve is a place where the curve changes from increasing to decreasing or from decreasing to increasing. If any given turning point has a tangent line, which is usually the case as most of the time our curves are smooth, then the slope is zero. But the slope of the tangent line is the derivative of the function. So, if we want to find turning points, the natural place to look would be where the derivative is zero. Let's apply the derivative to quickly find the turning points and global minimum of this particular quadratic. To solve this, observe that the derivative is 2x minus 2, which is 0 when x equals 1. So, the turning point must occur when x equals 1, in which case, y equals minus 2. So, the turning point has coordinates 1, minus 2, and the global minimum is the y-coordinate which is minus 2. All of this is confirmed by drawing the associated parabola. Notice, if we draw the sine diagram for the derivative, we see that the derivative is negative to the left of x equals 1 and positive to the right, confirming that the function is decreasing from the left and increasing to the right of the apex. The next example involves a cubic polynomial, and the problem is to find all local and global extrema, firstly, over the whole real line and secondly, over the restricted interval between 0 and 5. To solve the first part of the problem, we find the derivative which is a quadratic, and which turns out to factorize as 3 times x minus 1 times x minus 3 so that the derivative is 0 when x equals 1 and 3. Very quickly, we've narrowed down the possibilities for extrema to just these two inputs. By drawing the sine diagram for the derivative, we should be able to tell what kind of extrema occur and where. We see from the factorization of y dashed that if x is bigger than 3 or less than 1, then y dashed is positive, and if x is between 1 and 3, then y dashed is negative. So, we get an up-down-up pattern of behavior of the curve with turning points at x equals 1, where there is a local maximum, and x equals 3 where there is a local minimum. The local maximum is the value of the function at x equals 1, which is 5, and the local minimum is the value at x equals 3, which is 1. Neither of these local extrema can be global because with non-restricted domain, the cubic can take arbitrarily large positive and negative values. Here's the graph of the function with its turning points and the local extrema appearing on the y-axis. In the second part of this problem, we need to find all extrema when the domain is now restricted to the interval from 0 to 5. The local maximum and minimum from the previous calculation are important because inputs x equals 1 and 3 fall within this domain. The question is really how far the curve falls away to the left and how much it climbs to the right. So, we evaluate the function at the left-hand endpoint of the interval x equals 0 and get the value 1 and at the right-hand endpoint, x equals 5 and get the value 21. We can now compare the full values 5, 1, 1, and 21. The global maximum is just the largest of these which is 21, and the global minimum is the smallest which is 1. This solves the second part of our problem. The graph is actually quite steep at x equals 5. So, to see what's going on, we need to adjust the scale of the axes, and then you can see how easily the local maximum of 5 is surpassed by the global maximum of 21. The global minimum, in fact, is achieved exactly twice, both at the left-hand endpoint of the interval and at x equals three inside the interval. The technique that we just used applies generally to curves and is called the closed interval method. Consider a continuous function f to find the inputs x between a and b, including a and b. The interval a, b of inputs with square brackets is referred to as closed because it contains both of the endpoints. Being continuous, you can imagine drawing the graph of f without lifting your pen off the paper. To find the global maximum and minimum values, it suffices to find the largest and smallest values of the function. When evaluated at the endpoints of the interval a and b and that inputs where the derivative turns out to be 0, so the tangent line is horizontal or, where the derivative is undefined. In the last example, the derivative was defined everywhere. This is a very powerful result because for most functions, there are an infinite number of possible inputs, and this is saying that you only have to restrict attention typically to just a finite handful of points. In the last example, which is quite a sophisticated cubic, we only needed to evaluate the function at four points. We finished with an example, where the derivative is not defined everywhere. The function f has the rule f of x equals the magnitude of x minus 1 plus 3 restricted to x between minus 2 and 5. If x is greater than or equal to 1, then the magnitude sign can simply disappear and the rule quickly becomes x plus 2. If x is less than 1, then the magnitude sign can be removed by replacing x minus 1 by 1 minus x, and the rule quickly becomes 4 minus x. These are two linear pieces with derivative 1 for x greater than 1 and minus 1 for x less than 1. Note that the values 1 and minus 1 are both non-zero. In fact, there can be no derivative at x equals 1 because it's a sharp point on the curve. So, the tangent line becomes ambiguous, and there's no well-defined slope. Here's the graph trimmed to only include inputs x between minus 2 and 5. We can solve the problem completely by inspecting the graph but let's see what the closed interval method predicts. The method tells us we only need to check endpoints at x equals 1 since the derivative is never zero and is undefined at x equals 1. So, we check f of minus 2, which evaluates to 6, f of 5 which evaluates to 7, and f of 1 which evaluates to 3 of which 7 is the largest and 3 is the smallest. These correspond on the graph to the global maximum and global minimum of the function respectively. Note that the value 6, which occurs at the left-hand endpoint of the domain, is a local but not global maximum. This then solves our problem. Note that though we looked at the graph, the closed interval method can be followed blindly and mechanically without any visual assistance. It's important to have such methods to deal with functions whose graphs are so complicated that it may be too difficult to draw them or even imagine what they look like. In today's video, we discussed local and global maxima and minima, collectively called extrema, for rules of functions, considered associated turning points, where the curve changes from increasing to decreasing or decreasing to increasing and found them by exploiting the derivative and the fact that the tangent line to a curve at a turning point must be horizontal and have zero slope. We finished with discussion and illustrations of the closed interval method, which locates global extrema by narrowing attention to endpoints of the domain and points where the derivative of zero is undefined. 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.