Daniel B. answered 11/03/22
A retired computer professional to teach math, physics
There are a couple ways of doing it, both involving gradients.
So I assume that you have covered gradients, but I will not assume that you learned about
Lagrange multipliers.
If I am wrong and you are supposed to use Lagrange multipliers, then you can do that,
and get the same equations as below.
Denote
f(x, y, z) = xy + 12x + z²
Then
∇f = (y+12, x, 2z)
For any point (x, y, z), the vector (x, y, z) connects the origin with the point (x, y, z), and
its length √(x² + y² + z²) is the distance we want to minimize.
It will be locally minimal if the vector (x, y, z) is perpendicular to the surface,
that is, if it is parallel to the gradient ∇f at (x, y, z),
that is, if is there is a multiplier t so that
t(x, y, z) = ∇f
That gives us the three equations
tx = y+12 (1)
ty = x (2)
tz = 2z (3)
Together with the equation of the surface
xy + 12x + z² = 129 (4)
we have four equations and four unknowns.
Case 1: z ≠ 0
Then equation (3) yields t = 2, and
equation (2) yields x = 2y.
Rewriting equation (1)
4y = y + 12
which yields
y = 4
and thus x = 8.
Substituting x and y into equation (4) and simplifying,
z² = 1
Hence z = 1 or z = -1.
Both points (8, 4, 1) and (8, 4, -1) have the same distance 9 from the origin.
So these are both candidates for the closest point.
Case 2. z = 0
Then equations (1), (2), (3), (4) simplify into
tx = y+12
ty = x
xy + 12x = 129
Unfortunately, this set of equations does not have a simple solution.
Instead we can argue that no point (x, y, 0) on the surface can be as close
to the origin as the points (8, 4, 1) and (8, 4, -1) obtained in Case 1.
In case 1 where z = 1 or z = -1, the equation of the surface simplifies to the curve
xy + 12x + 1 = 129, or equivalently
y = f1(x) = 128/x - 12
In Case 2 where z = 0, the equation of the surface simplifies to the curve
xy + 12x = 129, or equivalently
y = f2(x) = 129/x - 12
Both f1 and f2 represent a hyperbola with a positive and a negative branch.
Lemma:
Assume a given hyperbola y = a/x - b where a > 0 and b > 0.
Then for any point (x, y) on the negative branch of the parabola there is a point
on the positive branch that is closer to the origin.
Proof:
The distance of a point (x, y) to the origin is given by
d(x, y) = √(x² + y²) = √(x² + a²/x² - 2ab/x + b²)
For x < 0, -2ab/x > 0 and therefore d(x, y) > d(-x, y)
This proves the lemma.
Using the Lemma we conclude that for the curve f2 the closest point to the origin
must lie on the positive branch.
Now we argue that for any such point (x, y), the curve f1 must have a point even closer.
Notice that for any x > 0, f1(x) < f2(x).
Therefore for any x > 0, the point (x, f1(x)) is closer to the origin that (x, f2(x)).
The final answer is that the shortest distance is 9 obtained in Case 1.