Chapter 4: Partial Differentiation
Section 4.8: Unconstrained Optimization
Example 4.8.8
Find the minimum distance between the point 1,−2,3 and the plane 5 x+3 y+2 z=7.
Solution
Mathematical Solution
Take as the objective function fx,y,z=x−12+y+22+z−32, the square of the distance of the arbitrary point x,y,z from the point 1,−2,3, and let the constraint be the plane described by gx,y,z≡5 x+3 y+2 z−7=0.
The Lagrange multiplier method requires solving the equations in ∇f=λ ∇g, along with g=0, for x,y,z,λ. These equations are
2⁢x−2=5⁢λ,2⁢y+4=3⁢λ,2⁢z−6=2⁢λ,5⁢x+3⁢y+2⁢z−7=0
and have solution x,y,z=24/19,−35/19,59/19 ≐ 1.26,−1.84,3.11 with λ=2/19. The minimum distance between the point 1,−2,3 and the given plane is then 2/19≐0.324.
Maple Solution - Interactive
Initialize
Context Panel: Assign to a Name≻f
x−12+y+22+z−32→assign to a namef
Context Panel: Assign to a Name≻g
5 x+3 y+2 z−7→assign to a nameg
Context Panel: Assign to a Name≻F
f−λ g→assign to a nameF
Form and solve the equations of the Lagrange multiplier method
Calculus palette: Partial-differentiation operator Press the Enter key.
Context Panel: Solve≻Solve
Context Panel: Assign to a Name≻S
∂∂ x F=0,∂∂ y F=0,∂∂ z F=0,g=0
−5⁢λ+2⁢x−2=0,−3⁢λ+2⁢y+4=0,−2⁢λ+2⁢z−6=0,5⁢x+3⁢y+2⁢z−7=0
→solve
λ=219,x=2419,y=−3519,z=5919
→assign to a name
S
Obtain the minimum distance between the given point and the given plane
Expression palette: Evaluation template
Context Panel: Evaluate and Display Inline
Context Panel: Approximate≻5 (digits)
fx=a|f(x)S = 119⁢38→at 5 digits0.32444
A numeric solution can be obtained interactively as follows.
Write the sequence of objective function (here, f) and constraint equation; press the Enter key.
Context Panel: Optimization≻Minimize (local)
f,g=0
x−12+y+22+z−32,5⁢x+3⁢y+2⁢z−7=0
→minimize
0.324442842261524644,x=1.26315789473688,y=−1.84210526315806,z=3.10526315789488
The first number in the return is the minimum distance, that is, the minimum of f subject to the constraint g=0. The list of equations that follows give the coordinates of the point on the constraint plane where this minimizing point lies.
Maple Solution - Coded
Define the objective function f.
f≔x−12+y+22+z−32:
Define the constraint function g.
g≔5 x+3 y+2 z−7:
Implement the Lagrange multiplier technique via the LagrangeMultipliers command
S≔Student:-MultivariateCalculus:-LagrangeMultipliersf,g,x,y,z
2419,−3519,5919
Student:-MultivariateCalculus:-LagrangeMultipliersf,g,x,y,z,output=detailed
x=2419,y=−3519,z=5919,λ1=219,x−12+y+22+z−32=219
Alternatively, use the Equate and eval commands to evaluate f at the solution S.
evalf,Equatex,y,z,S = 219
Find the minimum distance between the given point and the given plane
Apply the evalf command.
evalf2/19 = 0.3244428423
<< 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