Chapter 4: Partial Differentiation
Section 4.8: Unconstrained Optimization
Example 4.8.4
Find and classify the critical (i.e., stationary) points for fx,y=x3−y3−3 x y+4.
Solution
Mathematical Solution
Critical points are the solution of the equations ∇f=0, that is, of the equations
3⁢x2−3⁢y=0,−3⁢y2−3⁢x=0
There are two solutions, namely, P:−1,1 and Q:0,0. The Second-derivative test declares P to be a local (relative) maximum with function value 5, whereas it declares Q to be a saddle with function value 4.
To implement the Second-Derivative test at P, calculate fxxP= −6, fyyP= −6, and fxyP=−3 so that
T=fxxP⋅fyyP−fxy2P=27
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−3−3−6 and the sequence of principal minors with 1 prepended: 1,−6,27. The signs alternate, so the critical point P is a local maximum.
To implement the Second-Derivative test at Q, calculate fxxQ= 0, fyyQ= 0, and fxyQ=−3 so that
T=fxxQ⋅fyyQ−fxy2Q=−9
Since T= −9<0, the critical point P is a saddle.
The Hessian at Q is H=fxx(Q)fxy(Q)fxy(Q)fyy(Q) = 0−3−30 and one of the principal minors zero, so Sylvester criterion does not apply.
Figure 4.8.4(a) shows that portion of the surface generated by f that is consistent with the claim that P is a local maximum, and that Q is a saddle. The contour map in Figure 4.8.4(b) reveals the maximum at P (surrounded by the closed loop) and the saddle at Q.
Figure 4.8.4(a) Surface generated by f
Figure 4.8.4(b) Level curves for f
Maple Solution - Interactive
Initialize
Tools≻Load Package: Student Multivariate Calculus
Loading Student:-MultivariateCalculus
Context Panel: Assign Name
f=x3−y3−3 x y+4→assign
Solution via task template
Tools≻Tasks≻Browse:
Calculus - Multivariate≻Optimization≻
Critical Points and the Second Derivative Test
Objective Function f
f
x3−y3−3⁢x⁢y+4
List of Independent Variables
v≔x,y
v:=x,y
Equations ∇f=0
convertStudentMultivariateCalculusGradient,,list;
3⁢x2−3⁢y,−3⁢y2−3⁢x
Critical Points
temp≔removehas,solve,v,Explicit,I:convertseqevalv,tempk,k=1..nopstemp,list
−1,1,0,0
Second Derivative Test
StudentMultivariateCalculusSecondDerivativeTest,v=;
LocalMin=,LocalMax=−1,1,Saddle=0,0
Hessians and their Eigenvalues
Temp≔StudentMultivariateCalculusSecondDerivativeTest,v=,output=hessian: for k to nopsTemp do Tempk,convertLinearAlgebraEigenvaluesTempk,list; end do;
The critical point −1,1 is a local (relative) maximum. The first Hessian matrix in the last line of the task template is the matrix of second partial derivatives evaluated at this critical point. Since a discussion of eigenvalues is beyond the scope of the typical multivariate calculus course, apply Sylvester's criterion to the Hessian. Since the signs in the sequence 1,Q1,Q2=1,−6,27 alternate, the critical point is a local maximum.
The critical point 0,0 is a saddle. The Hessian at this point will have zero for one of its principal minors. Hence, the Sylvester criterion cannot be used.
Find critical points via first principles
Calculus palette: Partial derivative operator Press the enter key.
Context Panel: Solve≻Solve (explicit)
∂∂ x f=0,∂∂ y f=0
→solve
x=0,y=0,x=−1,y=1,x=12+12⁢I⁢3,y=−12+12⁢I⁢3,x=12−12⁢I⁢3,y=−12−12⁢I⁢3
Alternate calculation of the critical points
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
→gradient
→to list
→equate to 0
Second-Derivative test at −1,1
Expression palette: Evaluation template Calculus palette: Partial-derivative operators
Context Panel: Evaluate and Display Inline
∂2∂x2 f⋅∂2∂y2 f−∂2∂ y⁢∂ x f2x=a|f(x)x=−1,y=1 = 27
∂2∂x2 fx=a|f(x)x=−1,y=1 = −6
Obtain f−1,1
Expression palette: Evaluation template
fx=a|f(x)x=−1,y=1 = 5
Second-Derivative test at 0,0
∂2∂x2 f⋅∂2∂y2 f−∂2∂ y⁢∂ x f2x=a|f(x)x=0,y=0 = −9
The function value at 0,0 is easily seen to be 4.
Maple Solution - Coded
Install the Student MultivariateCalculus package.
withStudent:-MultivariateCalculus:
Define f.
f≔x,y→x3−y3−3 x y+4:
Obtain critical points
Use the Gradient, Equate, and solve commands to solve the equations resulting from ∇f=0. Note the use of the parameter "explicit" in the solve command.
solveEquateGradientfx,y,x,y,0,0,explicit
Apply the SecondDerivativeTest command to the critical point
SecondDerivativeTestfx,y,x,y=0,0,−1,1
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,2f2−1,1; D1,1f−1,1
27
T≔D1,1f⋅D2,2f−D1,2f20,0
−9
At the critical point −1,1, T=27>0 and fxx<0, so the critical point is a local (relative) maximum; this maximum value is f−1,1=5 . At the critical point 0,0, T= −9<0, so this critical point is a saddle, at which point f has the value 4.
Apply Sylvester's criterion at −1,1
Use the SecondDerivativeTest command to return the Hessian matrix
H≔SecondDerivativeTestfx,y,x,y=−1,1,output=hessian =
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,27
An alternative way to obtain the Hessian:
Matrix2,2,i,j→Di,jf−1,1 =
Apply Sylvester's criterion at 0,0
H≔SecondDerivativeTestfx,y,x,y=0,0,output=hessian =
1,0,−9
Matrix2,2,i,j→Di,jf0,0 =
<< 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