maths.free › Multivariable Calculus › 3. Derivatives of Multivariable Functions › Optimization
Optimization
This section relies on the geometric tools developed in the sections on the first and second partial derivatives ( and ). If you omit the material on absolute extrema, then this can be covered in a single class meeting.
Optimization
This section relies on the geometric tools developed in the sections on the first and second partial derivatives ( and ). If you omit the material on absolute extrema, then this can be covered in a single class meeting. Because absolute extrema involve a significant amount more work to do optimization on the boundary, that is likely a separate class meeting (or could be paired with Lagrange Multipliers).
Introduction
In single-variable calculus we learned that the derivative is useful for finding the local maxima and minima of functions. We also saw how these ideas can be employed in applied settings. In particular, if a function \(f\), such as the one shown in Figure is differentiable everywhere, we know that the tangent line is horizontal at any point where \(f\) has a local maximum or minimum. Horizontal tangent lines occur when the derivative \(f'\) is zero. Thus, one way to find possible extreme values of a function is to first find where the function's derivative is zero. Not every point where \(f'(a)=0\) will correspond to either a local maximum or local minimum, however. You may also recall that the concavity at a location where the derivative is zero can be used to help determine if a point is a local maximum or local minimum.
In multivariable calculus, we are often similarly interested in finding the greatest or least values that a function may achieve. Moreover, there are many applied settings in which a quantity of interest depends on several variables. In the preview activity below, we will use the application of elevation as a function of location to consider the characteristics that are necessary for an input to a function of two variables to correspond to a local maximum or local minimum. An emphasis of this activity is that we can only look at measurements at our current location to determine if a point is a local maximum or minimum.
As the Preview Activity demonstrates, points corresponding to local minima and local maxima must have a zero slope in every direction and the rate of the change after taking a small step in any direction must also be positive or negative, respectively. This will form the conceptual basis of our attempt to find and classify extreme points of functions of two variables.
Condensed — the full section is in Boelkins et al., Active Calculus Multivariable.
Extrema and Critical Points
One of the important applications of single-variable calculus is the use of derivatives to identify local extremes of functions (that is, local maxima and local minima). Using the tools we have developed so far, we can extend the concept of local maxima and minima to multivariable functions.
We use the term extremum point to refer to any point \((x_0,y_0)\) at which \(f\) has a local maximum or minimum. In addition, the function value \(f(x_0,y_0)\) at an extremum is called an extremal value. Figure illustrates the graphs of two functions that have an absolute maximum and minimum, respectively, at the origin \((x_0,y_0) = (0,0)\).
In single-variable calculus, we saw that the extrema of a continuous function \(f\) always occur at critical numbers, which are values of \(x\) where \(f\) fails to be differentiable or where \(f'(x) = 0\). Said differently, critical numbers provide the locations where the extrema of a function may appear. Our work in Preview Activity suggests that something similar happens with two-variable functions.
Suppose that a continuous function \(f\) has an extremum at \((x_0,y_0)\). In this case, the trace \(f(x,y_0)\) has an extremum at \(x_0\), which means that \(x_0\) is a critical number of \(f(x,y_0)\). Therefore, either \(f_x(x_0,y_0)\) does not exist or \(f_x(x_0,y_0) = 0\). Similarly, either \(f_y(x_0,y_0)\) does not exist or \(f_y(x_0,y_0) = 0\). This implies that the extrema of a two-variable function occur at points that satisfy the following definition.
Condensed — the full section is in Boelkins et al., Active Calculus Multivariable.
Classifying Critical Points: The Second Derivative Test
While the extreme values of a continuous function \(f\) always occur at critical numbers, it is important to note that not every critical point leads to an extremum. Recall, for instance, \(f(x) = x^3\) from single variable calculus. Because \(f'(0)=0\), we know that \(x_0=0\) is a critical number. However, \(x_0 = 0\) is not the location of a local maximum or a local minimum of \(f\). Geometrically, this corresponds to the tangent line \(x_0=0\) being horizontal as seen in but at a critical number where \(f(x_0)\) is neither greater than or equal to or less than or equal to all values \(f(x)\) with \(x\) near \(x_0\).
As we have seen a few times already, a similar situation can arise in a multivariable setting. Let's look at the function \(f(x,y) = x^2 - y^2\) whose graph and contour plot are shown in Figure. Because \(\nabla f = \langle 2x, -2y\rangle\), we see that the origin \((x_0,y_0)=(0,0)\) is a critical point. However, this critical point is neither a local maximum nor a local minimum. We can explain why this happens by noticing that the origin is a local minimum on the trace defined by \(y=0\), while the origin is a local maximum on the trace defined by \(x=0\). We call such a critical point a saddle point due to the shape of the graph near the critical point.
As in single-variable calculus, we would like to have an algebraic test to help us identify whether a critical point is a local maximum, local minimum, or neither. Recall that the Second Derivative Test for single-variable functions states that if \(x_0\) is a critical number of a function \(f\) for which \(f'(x_0)=0\) and \(f''(x_0)\) exists, then we can conclude that
- \(f''(x_0) \lt 0\)\(x_0\)
- \(f''(x_0) \gt 0\)\(x_0\)
- \(f''(x_0) = 0\)
At a critical point for a function of two variables, we must look at the concavity in all directions around our point. Use the dropdown box in to select three different types of critical point to examine graphically. Use the slider to change the direction in which the red trace is plotted. Notice that no matter what kind of critical point behavior is selected, the blue tangent plane is horizontal and the red trace curve is tangent to the blue plane.
Condensed — the full section is in Boelkins et al., Active Calculus Multivariable.
Optimization on a Restricted Domain
The Second Partial Derivatives Test helps classify critical points for a function of two variables, but it does not tell us if the function has an absolute maximum or minimum at each such point. For single-variable functions, the Extreme Value Theorem says that a continuous function on a closed interval \([a, b]\) must have both an absolute maximum and minimum on that interval, and that these absolute extremes must occur at either an endpoint or at a critical number inside the interval. Thus, finding the absolute maximum and absolute minimum of a single-variable function follows a straightforward list of steps: determine the critical points in the interval, evaluate the function at these critical points and at the endpoints of the interval, and identify the largest and smallest output values as the absolute maximum and absolute minimum respectively.
A similar approach works for functions of two variables, once we have determined the appropriate replacement for the idea of the endpoints of an interval. For functions of two variables, regions in the \(xy\)-plane that are both closed and bounded play the role that closed intervals did for functions of a single variable. A closed region is a region that contains its boundary. The unit disk \(x^2+y^2 \leq 1\) is closed, for example, while its interior \(x^2+y^2 \lt 1\) is not. A bounded region is one that does not stretch to infinity in any direction. Just as for functions of a single variable, continuous functions of several variables that are defined on closed, bounded regions must have absolute maxima and minima in those regions. The endpoints of \([a,b]\) are the boundary of the interval, and the boundary of a region in the \(xy\)-plane will provide the additional locations beyond critical points at which we must check for absolute extremes.
If \(f= f(x,y)\) is a continuous function on a closed and bounded region \(R\) in the \(xy\)-plane, then \(f\) has an absolute maximum and an absolute minimum in \(R\).
To find the highest point in a state, you would need to look up the elevations for the tops of the hills/mountains and compare those values to the elevation along the state's borders. Note that the elevation along a border of a state is a one-dimensional maximization problem, which means that tools from single-variable calculus can be applied.
The absolute extremes must occur at either a critical point in the interior of \(R\) or at a boundary point of \(R\). We therefore must test both possibilities, as we demonstrate in the following example.
Condensed — the full section is in Boelkins et al., Active Calculus Multivariable.
Practice (2)
Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.
-
If a continuous function \(f\) of a single variable has two critical numbers \(c_1\) and \(c_2\) at which \(f\) has relative maximum values, then \(f\) must have another critical number \(c_3\), because it is impossible to have two mountains without some sort of valley in between. The other critical point can be a saddle point (a pass between the mountains) or a local minimum (a true valley). (From Calculus in Vector Spaces by Lawrence J. Corwin and Robert H. Szczarb.) Consider the function \(f\) defined by \(f(x,y) = 4x^2e^y -2x^4 -e^{4y}\). (From Ira Rosenholz in the Problems Section of the Mathematics Magazine, Vol. 60 NO. 1, February 1987.) Show that \(f\) has exactly two critical points, and that \(f\) has relative maximum values at each of these critical points. Explain how this function \(f\) illustrates that it really is possible to have two mountains without some sort of valley in between. Use appropriate technology to draw the surface defined by \(f\) to see graphically how this happens.
答えを明らかにしろ
The critical points for this function \(f\) occur when \(f_x(x,y)\) and \(f_y(x,y)\) are simultaneously 0. Now \[\begin{aligned}\end{aligned}\].
To solve the system \[\begin{aligned}8xe^y - 8x^3 \amp = 0 \\ 4x^2e^y-4e^{4y} \amp = 0\end{aligned}\] we multiply both sides of the first equation by \(-\frac{1}{2}x\) and subtract corresponding sides of the second equation to obtain the equation \(-4x^4+4e^{4y} = 0\). This makes \(x^4 = e^{4y} = (e^y)^4\) or \(x = \pm e^y\). With \(x^2 = e^{2y}\), the second equation tells us that \(4e^{3y} - 4e^{4y} = 0\) or \(4e^{3y}(1-e^y) = 0\). This makes \(1-e^y=0\) or \(y=0\). So our critical points are \((1,0)\) and \((-1,0)\).
With \[\begin{aligned}\end{aligned}\], we have \[\begin{aligned}\end{aligned}\].
Since \(f_{xx}(-1,0) = f_{xx}(1,0) = -16\), the Second Derivative Test shows that \(f\) has a relative maximum value at each of these critical points.
Because \(f\) has only these two critical points, it is impossible for \(f\) to have another critical point to make a saddle point (a pass between the mountains) or a local minimum (a true valley). So \(f\) provides an example that it is possible to have two mountains without some sort of valley in between.
-
If a continuous function \(f\) of a single variable has exactly one critical number with a relative maximum at that critical point, then the value of \(f\) at that critical point is an absolute maximum. In this exercise we see that the same is not always true for functions of two variables. Let \(f(x,y) = 3xe^y-x^3-e^{3y}\) (from The Only Critical Point in Town Test by Ira Rosenholz and Lowell Smylie in the Mathematics Magazine, VOL 58 NO 3 May 1985.). Show that \(f\) has exactly one critical point, has a relative maximum value at that critical point, but that \(f\) has no absolute maximum value. Use appropriate technology to draw the surface defined by \(f\) to see graphically how this happens.
答えを明らかにしろ
The critical points for this function \(f\) occur when \(f_x(x,y)\) and \(f_y(x,y)\) are simultaneously 0. Now \[\begin{aligned}\end{aligned}\].
To solve the system \[\begin{aligned}3e^y-3x^2 \amp = 0 \\ 3xe^y-3e^{3y} \amp = 0\end{aligned}\] we multiply both sides of the first equation by \(x\) and subtract corresponding sides of the second equation to obtain the equation \(-3x^3+3e^{3y} = 0\). This makes \(x^3 = e^{3y} = (e^y)^3\) or \(x = e^y\). Substituting into the second equation we see that \(3e^{2y} - 3e^{3y} = 0\) or \(3e^{2y}(1-e^y) = 0\). This makes \(1-e^y=0\) or \(y=0\). So our only critical point is \((1,0)\).
With \[\begin{aligned}\end{aligned}\], we have \[\begin{aligned}\end{aligned}\].
Since \(f_{xx}(1,0) = -6\), the Second Derivative Test shows that \(f\) has a relative maximum value at its single critical point.
Notice that \[\begin{aligned}\end{aligned}\], so \(f\) does not have an absolute maximum value.
Symbols used here
Vector of partial derivatives; points uphill.
2.71828…, the base whose exponential is its own derivative.
Inequalities that allow equality; < and > exclude it.
Derivative with respect to x, holding the other variables fixed.
Antiderivative (indefinite) or signed area from a to b (definite).
Integral over a region of the plane; integral around a closed curve.
A quantity with magnitude and direction; a column of numbers.
Σ u_i v_i; the length of v, √(v·v).
How to: Optimization
- What properties will a local maximum or minimum of f(x,y) have?
- How can we determine whether critical points of f(x,y) are local maxima or minima?
- How can we find the absolute maximum and minimum of f(x,y) on a closed and bounded domain?
Questions people ask
What is a partial derivative?
The ordinary derivative with respect to one variable while every other variable is frozen — the slope of the surface in one coordinate direction.
What does the gradient point at?
Uphill: the direction of steepest increase, with length equal to that steepest slope. It is perpendicular to the level curves.
あなた自身を試してみてください
Parts of this page are adapted from Boelkins et al., Active Calculus Multivariable (CC BY-SA 4.0). Condensed and re-explained here; errors are ours.
ここに Multivariable Calculus
Functions of several variablesPartial derivatives and the gradientOptimisation in several variablesDouble and triple integralsVector fields, line integrals and the big theorems