Chapter 4: Partial Differentiation
Section 4.8: Unconstrained Optimization
Example 4.8.5
Find and classify the critical (i.e., stationary) points for fx,y=2 x y−3 x4−5 y4+2−y+7.
Solution
Mathematical Solution
Critical points are the solution of the equations ∇f=0, that is, of the equations
−12⁢x3+2⁢y=0,−20⁢y3+2⁢x−1=0
There is one real solution, namely, P:−0.4222805036,−0.4518084433, which must be found numerically . The Second-derivative test declares P to be a local (relative) maximum with function value approximately 9.5.
To implement the Second-Derivative test at P, calculate fxxP≐−6.4, fyyP≐−12.2, and fxyP=2 so that
T=fxxP⋅fyyP−fxy2P≐74.6
Since T>0 but fxxP<0, the critical point P is a local maximum.
To apply Sylvester's criterion to P, obtain the Hessian H=fxx(P)fxy(P)fxy(P)fyy(P) ≐ −6.422−12.2 and the sequence of principal minors with 1 prepended: 1,−6.4,74.6. The signs alternate, so the critical point P is a local maximum.
Figure 4.8.5(a) shows that portion of the surface generated by f that is consistent with the claim that P is a local maximum. Figure 4.8.5(b) shows fx=0 in black, and fy=0 in red, showing that there is one critical point in the third quadrant. This critical point must be determined numerically.
Figure 4.8.5(a) Surface generated by f
Figure 4.8.5(b) The equations fx=0,fy=0
Maple Solution - Interactive
Initialize
Tools≻Load Package: Student Multivariate Calculus
Loading Student:-MultivariateCalculus
Context Panel: Assign Name
f=2 x y−3 x4−5 y4+2−y+7→assign
Find critical point via first principles
Calculus palette: Partial derivative operator Press the enter key.
Context Panel: Solve≻Numerically Solve
Context Panel: Assign to a Name≻C
∂∂ x f=0,∂∂ y f=0
→solve
x=−0.4222805036,y=−0.4518084433
→assign to a name
C
Assign X and Y the values of x and y at the critical point
Expression palette: Evaluation template
Context Panel: Evaluate and Display Inline
Context Panel: Assign to a Name≻X or Y, as appropriate
xx=a|f(x)C = −0.4222805036→assign to a nameX
yx=a|f(x)C = −0.4518084433→assign to a nameY
Alternate calculation of the critical point
Type f and press the Enter key.
Context Panel: Student Multivariate Calculus≻ Differentiate≻Gradient
Context Panel: Conversions≻To List
Context Panel: Conversions≻Equate to 0
f
−3⁢x4−5⁢y4+2⁢x⁢y−y+9
→gradient
−12⁢x3+2⁢y−20⁢y3+2⁢x−1
→to list
−12⁢x3+2⁢y,−20⁢y3+2⁢x−1
→equate to 0
Second-Derivative test at X,Y
Expression palette: Evaluation template Calculus palette: Partial-derivative operators
∂2∂x2 f⋅∂2∂y2 f−∂2∂ y⁢∂ x f2x=a|f(x)C = 74.62569511
∂2∂x2 fx=a|f(x)C = −6.419549653
Obtain fX,Y
fx=a|f(x)C = 9.529646229
The test number T=fxxfyy−fxy2 evaluated at the critical point is positive, but fxx is negative. By the Second-Derivative test, conclude that the critical point is a local (relative) maximum.
Maple Solution - Coded
Install the Student MultivariateCalculus package.
withStudent:-MultivariateCalculus:
Define f.
f≔x,y→2 x y−3 x4−5 y4+2−y+7:
Obtain critical points
Use the Gradient, Equate, and fsolve commands to solve the cubic equations resulting from ∇f=0.
C≔fsolveEquateGradientfx,y,x,y,0,0,x,y;X≔evalx,C;Y≔evaly,C
Y≔−0.4518084433
Apply the SecondDerivativeTest command to the critical point
SecondDerivativeTestfx,y,x,y=X,Y
LocalMin=,LocalMax=−0.4222805036,−0.4518084433,Saddle=
Apply the second-derivative test from first principles
The differential operator D, applied to a function, returns a function. Hence, T=fxxfyy−fxy2 is a function evaluated at the one critical point.
T≔D1,1f⋅D2,2f−D1,2f2X,Y; D1,1fX,Y
−6.419549653
At the critical point X,Y, T>0 and fxx<0, so the critical point is a local (relative) maximum; this maximum value is fX,Y≐9.5 .
Apply Sylvester's criterion at X,Y
Use the SecondDerivativeTest command to return the Hessian matrix
H≔SecondDerivativeTestfx,y,x,y=X,Y,output=hessian
H≔−6.41954965322−12.24785216
Generate the sequence 1,Q1,…,Qn, where the Qk are the principal minors.
Obtain a principal minor by applying the Determinant command to the appropriate submatrix of H.
Use the seq command to form the sequence of principal minors.
1, seqLinearAlgebra:-DeterminantH1..k,1..k,k=1..2
1,−6.419549653,74.62569508
An alternative way to obtain the Hessian:
Matrix2,2,i,j→Di,jfX,Y = −6.41954965322−12.24785216
<< Previous Example Section 4.8 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