Chapter 4: Partial Differentiation
Section 4.10: Optimization on Closed Domains
Example 4.10.2
Find the extreme values of the function fx,y=2−x2−y2+2⁢x+2⁢y on the domain R consisting of the interior and boundary of the triangle whose sides are the x- and y-axes, and the line x+y=9.
Solution
Mathematical Solution
Figure 4.10.2(a) shows that part of the surface defined by f for which the support is the domain R.
The unconstrained extrema, obtained by solving the equations fx=fy=0, is f0,0=2.
Taking the constraints one at a time requires solving three constrained optimization problems, with each side of the triangle being the constraint in each of the three problems.
Figure 4.10.2(b), a graph of f0,y=2+2 y−y2, suggests the maximum f0,1=3, and the minimum f0,9=−61.
Figure 4.10.2(c), a graph of fx,0=2+2 x−x2, suggests the maximum f1,0=3 and the minimum f9,0=−61.
Figure 4.10.2(d), a graph of fx,9−x=−2⁢x2+18⁢x−61, suggests the maximum f9/2,9/2=−41/2 and the minima f0,9=f9,0=−61.
Taking the constraints two at a time requires finding the values of f at the intersection of the edges of the triangle, that is, at the vertices. These values are f0,0=2, f0,9=f9,0=−61, so the absolute minimum is −61, and the absolute maximum is f1,1=4.
use plots in module() local f,p1,p2,p3; f:=-x^2-y^2+2*x+2*y+2; p1:=plot3d(f,x=0..9,y=0..9-x, style=patchcontour): p2:=plot3d(-60,x=0..9,y=0..9-x,color=red): p3:=display([p1,p2],axes=frame,orientation=[-65,85,0],tickmarks=[5,5,6]); print(p3); end module: end use:
Figure 4.10.2(a) The surface over the triangle R
Figure 4.10.2(b) Along x=0
Figure 4.10.2(c) Along y=0
Figure 4.10.2(d) Along x+y=9
Each of the three constrained optimization problems obtained when applying the constraints one at a time is a candidate for the Lagrange multiplier method. However, in this example, the simplicity of the three optimization problems that result does not warrant the more elaborate machinery of the Lagrange multiplier approach.
Maple Solution - Interactive
Initialize
Context Panel: Assign Function
fx,y=2−x2−y2+2⁢x+2⁢y→assign as functionf
Solve the unconstrained problem
Calculus palette: Partial-derivative operator
Context Panel: Solve≻Solve
∂∂ x fx,y=0,∂∂ y fx,y=0
−2⁢x+2=0,−2⁢y+2=0
→solve
x=1,y=1
Context Panel: Evaluate and Display Inline
f1,1 = 4
Apply the constraints one at a time
Along x=0 (the y-axis): Context Panel: Differentiate≻With Respect To≻y Context Panel: Solve≻Solve
f0,y = −y2+2⁢y+2→differentiate w.r.t. y−2⁢y+2→solvey=1
f0,1 = 3
Along y=0 (the x-axis): Context Panel: Differentiate≻With Respect To≻x Context Panel: Solve≻Solve
fx,0 = −x2+2⁢x+2→differentiate w.r.t. x−2⁢x+2→solvex=1
f1,0 = 3
Along x+y=9: Press the Enter key.
Context Panel: Differentiate≻With Respect To≻x
fx,9−x
−x2−9−x2+20
→differentiate w.r.t. x
−4⁢x+18
x=92
f9/2,9−9/2 = −412
Take the constraints two at a time, that is, evaluate f at the vertices of the triangle
f0,0 = 2
f0,9 = −61
f9,0 = −61
Maple Solution - Coded
Define the objective function f.
f≔x,y→2−x2−y2+2⁢x+2⁢y:
Solve the unconstrained optimization problem
Apply the diff command to form the equations fx=fy=0, and the solve command to obtain their solution.
Evaluate f at the critical point.
solvedifffx,y,x=0,difffx,y,y=0
Along x=0 (the y-axis): Apply the solve and diff commands.
solvedifff0,y,y = 1
Along y=0 (the x-axis). Apply the solve and diff commands.
solvedifffx,0,x = 1
Along x+y=9: Apply the diff and solve commands to obtain the critical number along this edge.
solvedifffx,9− x,x = 92
Apply the constraints two at a time
<< Previous Example Section 4.10 Next Example >>
© Maplesoft, a division of Waterloo Maple Inc., 2024. All rights reserved. This product is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation.
For more information on Maplesoft products and services, visit www.maplesoft.com
Download Help Document