For maximizing/minimizing f(x,y,z,…) under a constraint g(x,y,z,…)=0, define
>L(x,y,z,λ)>=f(x,y,z)>+λg(x,y,z),>
then set all partial derivatives to 0.
Question: Find the shortest distance from the origin to the plane 2x+3y+4z=12.
解析
最小化 D2=x2+y2+z2,约束 2x+3y+4z=12。
用拉格朗日乘子或直接套点到平面距离公式:
D=22+32+42∣12∣=2912.
Original Explanation
Minimize D2=x2+y2+z2 subject to 2x+3y+4z=12.
Construct
L(x,y,z,λ)=x2+y2+z2+λ(2x+3y+4z−12).
Setting partial derivatives to 0:
⎩⎨⎧2x+2λ=0,2y+3λ=0,2z+4λ=0,2x+3y+4z=12.
Solve to get x=2924,y=2936,z=2948, so
D=x2+y2+z2=2912.
(Alternatively, use the plane-to-point distance formula a2+b2+c2∣d∣.)