# example of using Lagrange multipliers

One to determine the perpendicular distance of the parallel planes

 $Ax+By+Cz+D\;=\;0\quad\mbox{and}\quad Ax+By+Cz+E\;=\;0$

is to use the Lagrange multiplier method.  In this case we may to minimise the Euclidean distance of a point  $(x,\,y,\,z)$  of the former plane to a (fixed) point  $(x_{0},\,y_{0},\,z_{0})$  of the latter plane.

Thus we have the equation  $Ax_{0}+By_{0}+Cz_{0}+E\,=\,0$  which we can subtract from the first plane equation, getting

 $\displaystyle g\;:=\;A(x-x_{0})+B(y-y_{0})+C(z-x_{0})+D-E\;=\;0.$ (1)

This is the (only) constraint equation for minimising the square (http://planetmath.org/SquareOfANumber)

 $\displaystyle f\;:=\;(x-x_{0})^{2}+(y-y_{0})^{2}+(z-x_{0})^{2}$ (2)

of the distance of the points.

The polynomial functions $f$ and $g$ satisfy the differentiability requirements.  Accordingly, we can find the minimising point  $(x,\,y,\,z)$  by considering the system of equations formed by (1) and

 $\displaystyle\begin{cases}\frac{\partial f}{\partial x}+\lambda\frac{\partial g% }{\partial x}\;\equiv\;2(x-x_{0})+\lambda A\;=\;0,\\ \frac{\partial f}{\partial y}+\lambda\frac{\partial g}{\partial y}\;\equiv\;2(% y-y_{0})+\lambda B\;=\;0,\\ \frac{\partial f}{\partial z}+\lambda\frac{\partial g}{\partial z}\;\equiv\;2(% z-z_{0})+\lambda C\;=\;0.\end{cases}$ (3)

We solve from (3) the differences

 $x-x_{0}\;=\;-\frac{A\lambda}{2},\quad y-y_{0}\;=\;-\frac{B\lambda}{2},\quad z-% z_{0}\;=\;-\frac{C\lambda}{2}$

and set them into (1).  It then yields the value

 $\lambda\;=\;\frac{2(D-E)}{A^{2}+B^{2}+C^{2}}$

of the Lagrange multiplier, which we substitute into the preceding three equations obtaining

 $x-x_{0}\;=\;\frac{A(D-E)}{A^{2}+B^{2}+C^{2}},\quad y-y_{0}\;=\;\frac{B(D-E)}{A% ^{2}+B^{2}+C^{2}},\quad z-z_{0}\;=\;\frac{C(D-E)}{A^{2}+B^{2}+C^{2}}.$

These values give the minimal distance when put into the expression of $\sqrt{f}$:

 $d\;=\;\sqrt{\frac{(D-E)^{2}(A^{2}+B^{2}+C^{2})}{(A^{2}+B^{2}+C^{2})^{2}}}.$

Hence we have gotten the distance

 $d\;=\;\frac{|D-E|}{\sqrt{A^{2}+B^{2}+C^{2}}}.$
Title example of using Lagrange multipliers ExampleOfUsingLagrangeMultipliers 2013-03-22 18:48:12 2013-03-22 18:48:12 pahio (2872) pahio (2872) 7 pahio (2872) Example msc 51N20 msc 26B10 example of Lagrange multipliers ParallelismOfTwoPlanes ExampleNeedingTwoLagrangeMultipliers