Tom K. answered 07/26/20
Knowledgeable and Friendly Math and Statistics Tutor
Instead of finding shortest distance, we will find shortest distance squared.
Then, distance squared from (0,0,1) is x^2 + y^2 + (z-1)^2, and the constraint is z=x^2+y^2 or x^2+y^2 - z = 0
Using LaGrange multipliers on this problem is ridiculous, but I will do it below. First, without.
distance squared is x^2 + y^2 + (z-1)^2 = z + (z-1)^2 (We could make this substitution, as x^2+y^2 = z)
f'(z) = 1 + 2(z-1) = 2z - 1
2z - 1 = 0
z = 1/2
z + (z-1)^2 = 1/2 + (-1/2)^2 = 1/2 + 1/4 = 3/4
Then, as this is distance squared, the shortest distance is √3/2 on the circle z = 1/2, x^2 + y^2 = 1/2
f''(z) = 2 > 0, so this is a global minimum.
If we had gotten a solution with a negative z, we would have worried, but we didn't.
If you feel the need to use LaGrange multipliers, at the very least, I would use cylindrical coordinates.
Then, we would minimize r^2 + (z-1)^2 subject to r^2 = z
l(r,θ,z) = r^2 + (z-1)^2 + λ(r^2 -z)
∂l/∂r = 2r + 2rλ
∂l/∂z = 2(z-1) - λ
∂l/∂r = 0 implies 2r(1+λ) = 0
r = 0 or λ = -1
If r = 0, (x,y,z) = (0,0,0) This will be a local maximum. The distance is 1. It is clearly not a global maximum, as there is no upper limit as z increases toward infinity.
If λ = -1, ∂l/∂z = 2(z-1) - (-1) = 2z-2 + 1 = 2z - 1
2z - 1 = 0
z = 1/2
This is the same as our answer from above.
r^2 +(z-1)^2 = 1/2 +(1/2-1)^2 = 1/2 + 1/4 = 3/4, so minimum distance is √3/2