Problem: Determine the distance between $(0,0,0)$ and the straight line which we get by intersecting the two planes $x-y+z=1$ and $x+y-z=0$.
Distance between a point and origin: $f(x,y,z)=\sqrt{x^2+y^2+z^2}$ with $g_1=x-y+z-1=0$ and $g_2=x+y-z=0$
I think that $f$ gives us the distance between any point on the straight line of the two planes and the origin. By saying "the distance" we actually mean the shortest (the one orthogonal on the line). So we "minimize" the problem.
We can also take the quadratic of $f$ to make it easier.
So we get the lagrangian function:
$L=x^2+y^2+z^2-\lambda(x-y+z-1)-\mu(x+y-z)$
$\partial_xL=2x-\lambda-\mu=0 \Rightarrow \mu=2x-\lambda$
$\partial_yL=2+\lambda-\mu \Rightarrow \mu=2y+\lambda$
$\partial_zL=2z-\lambda+\mu=0 \Rightarrow \mu=-2z+\lambda$
Using the 2nd and 3th eq. we get $y=-z$
using $g_1, g_2$ we get the system of equations:
x-y+z=1
x+y-z=0
z+y=0
Which is solved by $p=(1/2, -1/4, 1/4)$
The wanted distance is now: $d=f(p)=\sqrt{6}/4$
Question
Now, what I don't get is where we actually did the minimizing or asked differently: How would I maximie this problem?
My thoughts: The thing we did above was just getting all extremal values. When minimizing, we'd choose the minimum and when maximizing, we'd choose the maximum. That's correct?
The parametric equation of the line of intersection of the planes is $$ x=1/2, y=-t/2, z=1/2 - t/2$$
The distance from the origin satisfies $$d^2 = 1/4 +t^2/4+(1-t)^2/4 $$
The minimum distance happens at $t=1/2$ and it is $d= \sqrt 6 /4.$
There is no maximum value as the distance grows without bound.