9.3-9.6 1. Partial Derivatives • The partial derivative of f(x, y) with

advertisement
9.3-9.6
1. Partial Derivatives
• The partial derivative of f (x, y) with respect to x is the derivative of f with
y constant.
• The partial derivative of f (x, y) with respect to y is the derivative of f with
x constant.
Consider the function f (x, y) = x2 + y 2 . If we want to find the partial derivative with
respect to x at (2, 4), one way is to substitute in y = 4 to create a function of x:
f (x, 4) = x2 + 16
fx (x, 4) = 2x
fx (2, 4) = 4
But what if we also wanted to find the partial derivative with respect to x at (2, 5)? Instead
of repeating the process over and over again, it might be better to come up with a formula
that works for any value of x and y. The definition of the partial derivative with respect
to x says that y should be held constant. That means that instead of treating it like a
variable, we pretend it just represents a number while we take the derivative.
f (x, y) = x2 + y 2
fx (x, y) = 2x + 0 = 2x,
because when we think of y as a constant, y 2 is just a number, so its derivative is 0. All
of the usual rules for taking derivatives still apply. Now we can see that for this function,
fx (2, 4) = fx (2, 5) = 4, because the partial derivative doesn’t depend on y at all. This
won’t always be the case.
Remember that for single variable functions, the derivative of f (x) + c is f 0 (x). The derivative of cf (x) is cf 0 (x). In other words, if a constant is added, you have to differentiate it
separately- although its derivative is 0. If a constant is multiplied, you don’t differentiate
it at all- just multiply it by the derivative.
1
2
9.3-9.6
Example 1. Find the partial derivatives of f (x, y) = xy + x2 y + 3x + y
All of the usual rules for taking derivatives still apply- including product, quotient, and
chain rules.
Example 2. Find the partial derivatives of f (x, y) = x ln (x) + x ln (y)
Example 3. Find the partial derivatives of f (x, y) = ln (xy)
Example 4. Find the partial derivatives of f (x, y) = (x + y)5
9.3-9.6
3
For single variable functions, we can find the second derivative. For multivariable functions, we have many second derivatives!
Let f (x, y) be a function with partial derivatives fx (x, y) and fy (x, y) The second derivatives of f are
• (fx (x, y))x = fxx is the partial derivative of fx with respect to x
• (fy (x, y))y = fyy is the partial derivative of fy with respect to y
• (fx (x, y))y = fxy is the partial derivative of fx with respect to y
• (fy (x, y))x = fyx is the partial derivative of fy with respect to x
When f is continuous, fxy = fyx
Example 5. Compute both partial derivatives and all 4 second order partial derivatives of
f (x, y) = 3y 2 + 2x2 y 2 + yex
Example 6. Compute both partial derivatives and all 4 second order partial derivatives of
f (x, y) = 3 ln (x) + 4y 2 e3x
4
9.3-9.6
Sometimes, other notation is used for the second order derivatives:
∂2z
= fxx
∂x2
∂2z
= fyx
∂x∂y
∂2z
= fyy
∂y 2
∂2z
= fxy
∂y∂x
2. Critical points and optimization
Multivariable functions can have relative minimums and maximums, in the same way
single variable functions do.
•
•
•
•
f
f
f
f
has
has
has
has
a
a
a
a
local maximum at (a, b) if f (a, b) ≥ f (x, y) for all (x, y) close to (a, b)
local minimum at (a, b) if f (a, b) ≤ f (x, y) for all (x, y) close to (a, b)
global maximum at (a, b) if f (a, b) ≥ f (x, y) for all (x, y)
global minimum at (a, b) if f (a, b) ≤ f (x, y) for all (x, y)
When f has a maximum or a minimum that isn’t on a boundary of the domain, it is
changing direction. At that point, any tangent line (and therefore the tangent plane) will
have slope 0. In particular, the tangent lines in the x and y directions will have slope 0.
Alternatively, if either of the partial derivatives is undefined, that could be a maximum or
minimum.
(a, b) is a critical point if it is not on the boundary of the domain and either
• fx (a, b) = 0 and fy (a, b) = 0
• or at least one of fx (a, b) or fy (a, b) is undefined.
Example 7. Find the critical points of f (x, y) = x2 + 2x + y 2
One way to classify the critical points as minimums or maximums is to try plugging in
points near the critical points.
Example 8. Determine whether the critical points in the last example are minimums and
maximums.
9.3-9.6
5
There is also, however, a faster and more analytic way to classify critical points:
The Second Derivative Test:
If (a, b) is a critical point where fx (a, b) = fy (a, b) = 0, then define D = fxx (a, b)fyy (a, b)−
fxy (a, b)2
• If D > 0 and fxx (a, b) > 0, then f has a local minimum at (a, b)
• If D > 0 and fxx (a, b) < 0, then f has a local maximum at (a, b)
• If D < 0 then f has neither a local maximum nor a local minimum at (a, b)
• If D = 0, the test is inconclusive.
Example 9. Find the minimums and maximums of f (x, y) = x2 y + 3x + 2y
Example 10. Find the minimums and maximums of f (x, y) = x2 + xy + 3y
6
9.3-9.6
3. Constrained Optimization
Suppose a company produces an item constructed from two materials, x and y. The
amount produced is given by f (x, y) = x2 y. If we think about maximizing production,
one way to do it would be to send x and y to ∞. This, however, is unrealistic; there’s
certainly a limit to the quantity of x and y the company can purchase. So, what we need
to do is maximize f under a given constraint. In this case, if both x and y cost 10 dollars,
g(x, y) = 10x + 10y represents the cost of materials. If the budget is 1, 500, our constraint
is 10x + 10y = 1500. We need to find x and y that maximize f and ensure that g ≤ 1500.
First, we can graph some of the contours. We are looking for a point that maximizes f
and lies below the contour 10x + 10y = 1500. That point turns out to be the point where
g is tangent to f ; this is true in general.
If f (x, y) has a global maximum or minimum on the constraint g(x, y) = c, to occurs
either at an endpoint of the constraint or at a point where the graph of the constraint is
tangent to a contour of f .
Example 11. For g(x, y) = 10x + 10y = 1, 500 the endpoints are (0, 150) and (150, 0).
We can see, however, that neither of these maximize f .
When two graphs or surfaces are tangent to each other, they have the same slope. Partial derivatives don’t correspond to slopes in quite the same way the derivatives of single
variable functions do; there is a slightly different interpretation:
If g(x, y) and f (x, y) are tangent at some point (a, b), then fx (x, y) = λgx (x, y) and
fy (x, y) = λgy (x, y) for some constant λ. We can use this to find the maximums and
minimums.
3.1. Method of Lagrange Multipliers. To maximize or minimize f (x, y) subject to a
constraint g(x, y) = c:
(1) First, find the partial derivatives of f and g
(2) Set up the equations fx = λgx and fy = λgy
(3) Now your goal is to use those two equations to find a relationship between x and y.
Usually, the best way to do that is solve both equations for λ and set them equal
to each other.
9.3-9.6
7
(4) Using that information about x and y, use substitution to make g(x, y) a function
of just one variable and solve.
(5) Once you have all the values of x and y, you need to plug into f to determine which
one is the maximum or minimum, as well as to check the endpoints of g.
Example 12. We’ll use the Lagrange multiplier method to solve our original question,
maximizingf (x, y) = x2 y subject to the constraint g(x, y) = 10x + 10y = 1500
Example 13. Find maximum and minimum values of f (x, y) = xy subject to g(x, y) =
4x2 + y 2 = 8.
8
9.3-9.6
f
λ = fgxx = gyy so λ represents the rate of change of the optimum value of f as the constraint
increases.
Another way to use Lagrange multipliers is to use the Lagrangian functions:
L(x, y, λ) = f (x, y) − λ(g(x, y) − c)
Notice that here, λ is being treated as a variable. To see the use of L, we can compute the
3 partial derivatives: When all three partial derivatives are zero, we have the same set of
equations used in the Lagrange Multiplier method; therefore, the critical points of L will
be the same points found by the Lagrange Multiplier method.
Example 14. Maximize f (x, y) = x + y subject to the constraint x2 + y 2 = 1
Download