Chapter 4: Partial Differentiation
Section 4.8: Unconstrained Optimization
Example 4.8.1
Find and classify the critical (i.e., stationary) points for fx,y=7−3 x2−5 y2+6 x−9 y+4.
Solution
Mathematical Solution
Critical points are the solution of the equations ∇f=0, that is, of the equations
−6⁢x+6=0,−10⁢y−9=0
There is but the one solution, namely, P:1,−9/10. This point, subjected to the Second-Derivative test, proves to be a local (relative) maximum; at this point, f1,−9/10=361/20≐18.05.
To implement the Second-Derivative test, calculate fxxP= −6, fyyP= −10, and fxyP=0 so that
T=fxxP⋅fyyP−fxy2P=60
Since T>0 but fxxP<0, the critical point P is a local maximum.
To apply Sylvester's criterion, obtain the Hessian H=fxx(P)fxy(P)fxy(P)fyy(P) = −600−10 and the sequence of principal minors with 1 prepended: 1,−6,60. The signs alternate, so the critical point P is a local maximum.
Figure 4.8.1(a) shows that portion of the surface generated by f that is consistent with the claim that the critical point is a local maximum.
Figure 4.8.1(a) The surface defined by f
Maple Solution - Interactive
Initialize
Tools≻Load Package: Student Multivariate Calculus
Loading Student:-MultivariateCalculus
Context Panel: Assign Name
f=7−3 x2−5 y2+6 x−9 y+4→assign
Solution via task template
Tools≻Tasks≻Browse:
Calculus - Multivariate≻Optimization≻
Critical Points and the Second Derivative Test
Objective Function f
f
−3⁢x2−5⁢y2+6⁢x−9⁢y+11
List of Independent Variables
v≔x,y
v:=x,y
Equations ∇f=0
convertStudentMultivariateCalculusGradient,,list;
−6⁢x+6,−10⁢y−9
Critical Points
temp≔removehas,solve,v,Explicit,I:convertseqevalv,tempk,k=1..nopstemp,list
1,−910
Second Derivative Test
StudentMultivariateCalculusSecondDerivativeTest,v=;
LocalMin=,LocalMax=1,−910,Saddle=
Hessians and their Eigenvalues
Temp≔StudentMultivariateCalculusSecondDerivativeTest,v=,output=hessian: for k to nopsTemp do Tempk,convertLinearAlgebraEigenvaluesTempk,list; end do;
The one critical point, namely, 1,−9/10, is a local (relative) maximum. The Hessian matrix in the last line of the task template is the matrix of second partial derivatives evaluated at the 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,60 alternate, the critical point is a local maximum.
Find critical points via first principles
Calculus palette: Partial derivative operator Press the enter key.
Context Panel: Solve≻Solve
∂∂ x f=0,∂∂ y f=0
→solve
x=1,y=−910
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
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=−9/10 = 60
∂2∂x2 fx=a|f(x)x=1,y=−9/10 = −6
Obtain f1,−9/10
Expression palette: Evaluation template
Context Panel: Approximate≻5 (digits)
fx=a|f(x)x=1,y=−9/10 = 36120→at 5 digits18.050
Maple Solution - Coded
Install the Student MultivariateCalculus package.
withStudent:-MultivariateCalculus:
Define f.
f≔x,y→7−3 x2−5 y2+6 x−9 y+4:
Obtain critical points
Use the Gradient, Equate, and solve commands to solve the equations resulting from ∇f=0.
solveEquateGradientfx,y,x,y,0,0
Apply the SecondDerivativeTest command to the critical point
SecondDerivativeTestfx,y,x,y=1,−9/10
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,2f21,−9/10; D1,1f1,−9/10
60
At the critical point, T=60 and fxx<0, so the critical point is a local (relative) maximum; this maximum value is f1,−9/10 = 361/20≐18.05.
Apply Sylvester's criterion
Use the SecondDerivativeTest command to return the Hessian matrix
H≔SecondDerivativeTestfx,y,x,y=1,−9/10,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,60
An alternative way to obtain the Hessian:
Matrix2,2,i,j→Di,jf1,−9/10 =
<< Chapter Overview 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