Find the shortest distance between the surfaces $$\frac{x^2}{25}+\frac{y^2}{16}+\frac{z^2}{9}=1 \qquad\text{and}\qquad x^2+y^2+z^2=4.$$
I tried to solve this problem as follows:
The problem reduces to testing for an extremum of the function
$$v[y(x),z(x)]=\int_{x_0}^{x_1} \sqrt{1+y'^2+z'^2}\;dx.....\tag{1}$$ Let $F=\sqrt{1+y'^2+z'^2}$.
Let $S_1$ be the surface $\displaystyle{\frac{x^2}{25}+\frac{y^2}{16}+\frac{z^2}{9}=1}$ and $S_2$ be the surface $x^2+y^2+z^2=4$. Consider the point of contact of the extremals of the functional on the surface $S_1$ as $A(x_0,y_0,z_0)$ and the point of contact of the extremals on $S_2$ as $B(x_1,y_1,z_1)$.
The extremals of the functional in Equation (1) are
$y=C_1x+C_2 \qquad...\tag{2}$ and $z=C_3x+C_4 \qquad...\tag{3}$
Since the ends of these extremals move on the surfaces $S_1$ and $S_2$, we get the following equations
$C_1x_0+C_2=y_0 \qquad .... \tag{4}$
$C_3x_0+C_4=z_0 \qquad .... \tag{5}$
$C_1x_1+C_2=y_1 \qquad .... \tag{6}$
$C_3x_1+C_4=z_1 \qquad .... \tag{7}$
The transversality conditions are
$F-y'F_{y'}+(\phi_x -z')F_{z'} \Bigg \vert_{x=x_0}=0 \qquad ....\tag{9}$
$F_{y'}+\phi_y F_{z'} \Bigg \vert_{x=x_0}=0 \qquad ....\tag{10}$
$F-y'F_{y'}+(\psi_x -z')F_{z'} \Bigg \vert_{x=x_1}=0 \qquad ....\tag{11}$
$F_{y'}+\psi_y F_{z'} \Bigg \vert_{x=x_1}=0 \qquad ....\tag{12}$
where $\phi(x,y)$ is the surface defining $S_1$ and $\psi(x,y)$ is the surface defining $S_2$.
Solving $S_1$ and $S_2$ for $z$, we get
$$\phi(x,y)=3\sqrt{1-\frac{x^2}{25}-\frac{y^2}{16}}$$ and $$\psi(x,y)=\sqrt{4-x^2-y^2}$$. Differentiating $\phi$ and $\psi$ partially with respect to $x$ and $y$, we get
$$\phi_x=-\frac{3x}{25\displaystyle{\sqrt{1-\frac{x^2}{25}-\frac{y^2}{16}}}}=-\frac{9x}{25z},$$
$$\phi_y=-\frac{3y}{16\displaystyle{\sqrt{1-\frac{x^2}{25}-\frac{y^2}{16}}}}=-\frac{9y}{16z},$$
$$\psi_x=-\frac{x}{\sqrt{4-x^2-y^2}}=-\frac{x}{z},$$
$$\psi_y=-\frac{y}{\sqrt{4-x^2-y^2}}=-\frac{y}{z},$$
Now substituting for $F$, $\phi_x$, $\phi_y$, $\psi_x$, $\psi_y$, $y'=C_1$ and $z'=C_3$ in Equations (9) - (12), we get the following equations.
$25z_0-9x_0C_3=0 \qquad .... \tag{13}$
$16z_0C_1-9y_0C_3=0 \qquad .... \tag{14}$
$z_1-C_3x_1=0 \qquad .... \tag{15}$
$C_1z_1-C_3y_1=0 \qquad .... \tag{16}$
Now we have to solve Equations (4) - (7) and Equations (13) - (16) for the eight unknowns $x_0$, $y_0$, $x_1$, $y_1$, $C_1$, $C_2$, $C_3$ and $C_4$, which I could not.
Hence, I request to verify whether the procedure adopted in solving this problem is correct and if there is any mistake, please point out. Thank you in advance.
Of course, the geometrical consideration of the two surfaces ( sphere inside ellipsoid) and symmetries obviously show that the couples of points $(0,0,2); (0,0,3)$ and $(0,0,-2) ; (0,0-3)$ are both at shorter distance $D=1$.
But we have to proceed with calculus of variation :
Let $(x,y,z)$ a point on the surface $\frac{x^2}{25}+\frac{y^2}{16}+\frac{z^2}{9}=1 \qquad (1)$
and $(X,Y,Z)$ a point on the surface $X^2+Y^2+Z^2=4 \qquad (2)$
Let $D$ be the distance between them : $D^2=(X-x)^2+(Y-y)^2+(Z-z)^2 \qquad (3)$
The extremum of $D$ are so that the differentials of Eqs.(1), (2), (3) be $=0$ : $$\begin{cases} \quad\frac{x\:dx}{25}+\frac{y\:dy}{16}+\frac{z\:dz}{9}=0 \qquad (4)\\ \quad X\:dX+Y\:dY+Z\:dZ=0 \qquad (5)\\ \quad (X-x)(dX-dx)+(Y-y)(dY-dy)+(Z-z)(dZ-dz)=0 \qquad (6)\\ \end{cases}$$ From (4) : $dz=-\frac{9x\:dx}{25}-\frac{9y\:dy}{16} \qquad (7)$
From (5) : $dZ=-\frac{X\:dX+Y\:dY}{Z} \qquad (8)$
Bringing (7) and (8) into (6) leads to : $$\left(x-X+\frac{9y}{25z}(Z-z)\right)dx+\left(y-Y+\frac{9y}{16z}(Z-z)\right)dy+\frac{Xz-xZ}{Z}dX+\frac{Yz-yZ}{Z}dY=0$$
The extremum correspond to any $dx$, $dy$, $dX$, $dY$ which imply : $$\begin{cases} x-X+\frac{9y}{25z}(Z-z)=0 \qquad (10)\\ y-Y+\frac{9y}{16z}(Z-z)=0\qquad (11)\\ \frac{Xz-xZ}{Z}=0\qquad (12)\\ \frac{Yz-yZ}{Z}=0\qquad (13) \end{cases}$$ From (12) and (13) : $X=\frac{Z}{z}x$ and $Y=\frac{Z}{z}y$. Putting them into (10) and (11) leads to :
$$(z-Z)\frac{x}{z}=0\quad \text{and} \quad(z-Z)\frac{y}{z}=0$$
The consideration of the case $z-Z=0$ lead to maximum values of $D$, which is not what we want.
The case $x=y=0$ leads to : $\begin{cases}\frac{z^2}{9}=1\\ Z^2=4 \end{cases}\quad$ from Eqs.(1) and (2).
$z=\pm 3$ and $Z=\pm 2$.
From Eq.(3) : $D^2=(Z-z)^2$. As a consequence, the cases for a minimum of $D^2$ are : $(z=3\:,\:Z=2)$ and $(z=-3\:,\:Z=-2)$