# Minimum Distance

• Oct 18th 2009, 11:01 AM
billym
Minimum Distance
Can somebody tell me if I've started this off right?

I need to use the Lagrange method to find the minimum distance from the point (1,2,3) to any point of the surface: $\displaystyle x + 2y - z = 2$

Let: $\displaystyle D^2=f(x,y,z)=(x-1)^2+(y-2)^2+(z-3)^2$

and

$\displaystyle g(x,y,z)=x+2y-z-2=0$

and then just carry on in the usual manner?
• Oct 18th 2009, 03:00 PM
tonio
Quote:

Originally Posted by billym
Can somebody tell me if I've started this off right?

I need to use the Lagrange method to find the minimum distance from the point (1,2,3) to any point of the surface: $\displaystyle x + 2y - z = 2$

Let: $\displaystyle D^2=f(x,y,z)=(x-1)^2+(y-2)^2+(z-3)^2$

and

$\displaystyle g(x,y,z)=x+2y-z-2=0$

and then just carry on in the usual manner?

If by "the usual manner" you mean Lagrange multipliers and stuff, the answer is, I think, yes.

$\displaystyle D=\frac{|1+4-3-2|}{\sqrt{1+4+1}} = \frac{0}{\sqrt{6}}=0$

which doesn't surprise since the point (1,2,3) is on the surface.

Tonio
• Oct 18th 2009, 04:44 PM
billym
I can see that... so what is the problem with my method?

$\displaystyle f_x+ \lambda g_x=0 \Rightarrow 2(x-1)+ \lambda =0 \Rightarrow x=1-\frac{\lambda}{2}$ ...(1)

$\displaystyle f_y+ \lambda g_y=0 \Rightarrow 2(y-2)+ 2\lambda =0 \Rightarrow y=2-\lambda$ ...(2)

$\displaystyle f_z+ \lambda g_z=0 \Rightarrow 2(z-3)- \lambda =0 \Rightarrow z=3+\frac{\lambda}{2}$ ...(3)

Plug (1) to (3) into the constraint:

$\displaystyle (1-\frac{\lambda}{2})+2(2-\lambda)-(3+\frac{\lambda}{2})-2=0$

$\displaystyle \lambda=-\frac{8}{3}$

Which gives $\displaystyle x = 7/3, y = 14/3, z = 5/3$

So:

$\displaystyle D=\sqrt{(7/3-1)^2+(14/3-2)^2+(5/3-1)^2}=3.06$
• Oct 18th 2009, 05:01 PM
tonio
Quote:

Originally Posted by billym
I can see that... so what is the problem with my method?

$\displaystyle f_x+ \lambda g_x=0 \Rightarrow 2(x-1)+ \lambda =0 \Rightarrow x=1-\frac{\lambda}{2}$ ...(1)

$\displaystyle f_y+ \lambda g_y=0 \Rightarrow 2(y-2)+ 2\lambda =0 \Rightarrow y=2-\lambda$ ...(2)

$\displaystyle f_z+ \lambda g_z=0 \Rightarrow 2(z-3)- \lambda =0 \Rightarrow z=3+\frac{\lambda}{2}$ ...(3)

Plug (1) to (3) into the constraint:

$\displaystyle (1-\frac{\lambda}{2})+2(2-\lambda)-(3+\frac{\lambda}{2})-2=0$

$\displaystyle \lambda=-\frac{8}{3}$

Which gives $\displaystyle x = 7/3, y = 14/3, z = 5/3$

So:

$\displaystyle D=\sqrt{(7/3-1)^2+(14/3-2)^2+(5/3-1)^2}=3.06$

Simply you must form the function $\displaystyle H = f -\lambda g$ , with a minus and not with a plus! With this simple change you get $\displaystyle \lambda = 0$ , as you should.

Tonio
• Oct 18th 2009, 05:11 PM
billym
I see. I suppose this will explain my other wrong answers. I have about ten example questions from my notes and they all involve plus signs. How do you determine if its plus or minus? (obviously I've stopped visualizing it at this point)
• Oct 19th 2009, 11:43 AM
billym
I've looked at a bunch of Lagrange tutorials, but they're all so different. I'm sure these basic questions aren't too difficult, but I seem to be stuck.

The question i am trying solve is:

Using the Lagrange multiplier method, find the minimum distance from the point (1,2,3) to any point on the surface defined by:

$\displaystyle x+2y-z=2$

Every example that I have tells me that I should solve like this:

We have:

$\displaystyle D^2=f(x,y,z)=(x-1)^2+(y-2)^2+(z-3)^2, g(x,y,z)=x+2y-z-2=0$

$\displaystyle f_x+\lambda g_x = 0 \Rightarrow$ ...(and so on)

$\displaystyle f_y+\lambda g_y = 0 \Rightarrow$ ...(and so on)

$\displaystyle f_z+\lambda g_z = 0 \Rightarrow$ ...(and so on)

Why do I not get the right answer unless I use $\displaystyle -\lambda$ in these equations? (Headbang)
• Oct 19th 2009, 11:59 AM
billym
Actually that doesn't give me the correct answer either. In my journeys I have got:

$\displaystyle D=3.06,3,\sqrt 6$, and now $\displaystyle 6.22$

• Oct 19th 2009, 12:11 PM
tonio
Quote:

Originally Posted by billym
Actually that doesn't give me the correct answer either. In my journeys I have got:

$\displaystyle D=3.06,3,\sqrt 6$, and now $\displaystyle 6.22$

Well, I keep on getting zero....Let's see:

$\displaystyle H(x,y,z,\lambda)=f(x,y,z)-\lambda g(x,y,z)$ , and from here:

$\displaystyle H_{x}=f_{x}-\lambda g_{x}=2(x-1)-\lambda=0 \Longrightarrow x=\frac{\lambda}{2}+1$

$\displaystyle H_{y}=f_{y}-\lambda g_{y}=2(y-2)-2\lambda=0 \Longrightarrow y=\lambda +2$

$\displaystyle H_{z}=f_{z}-\lambda g_{z}=2(z-3)+\lambda=0 \Longrightarrow z=-\frac{\lambda}{2}+3$

Now just input in $\displaystyle g(x,y,z)$ this and you must get $\displaystyle 3\lambda =0$

Tonio
• Oct 19th 2009, 12:12 PM
billym
Ok so the the original equation should have been:

$\displaystyle D^2=f(x,y,z)=(1-x)^2+(2-y)^2+(3-z)^2$

Got it. Thanks. Goodnight.