Find the points on the sphere $x^2 + y^2 + z^2 = 4$ that are closest to, and farthest from the point $(3, 1, -1)$.
I identified that this is a constrained optimisation problem which I will solve using an auxiliary function and a Lagrange multiplier however I am struggling to continue from there as I am unsure which is the constraining function.
Any help would be greatly appreciated!
Do you have to use Lagrange multipliers?
The sphere is centered at the origin, and the point lies outside it. If you find the line through $(3,1,-1)$ and the origin, the closest and farthest points will be the two points of intersection between the line and the sphere.
Seeing that the length of the vector from the origin to the point of interest is $\sqrt{11}$, and the required vector is the same one scaled so that its length is 2, we can multiply it by $\frac{2}{\sqrt{11}}$ to get:
$$(\pm 6/\sqrt{11}, \pm 2/\sqrt{11}, \mp 2/\sqrt{11}).$$
Courtesy of Doug's expression in his answer:
$$F(x,y,z,\lambda) = (x-3)^2 + (y-1)^2 + (z+1)^2 - \lambda(x^2 + y^2 + z^2 - 4),$$
setting the four partials to zero gives the following four equations:
$$2x - 6 - 2 \lambda x = 0$$ $$2y - 2 - 2 \lambda y = 0$$ $$2z + 2 - 2 \lambda z = 0$$ $$x^2 + y^2 + z^2 - 4 = 0$$
Eliminating lambda in the top three equations leads to:
$$x = 3y = -3z.$$
This allows expressing the last of the four equations in one variable, which can then be solved:
$$\left(y - \frac{4}{11}\right)\left(y + \frac{4}{11}\right) = 0 \to y = \pm 2/\sqrt{11},$$ and the other values follow from there.