Given two n-dimensional surfaces, $S_1$ and $S_2$, how do we find a point where these surfaces touch?
In particular, let one of the surfaces, say $S_1$, be an ellipsoid given by an affine transformation $\mathbf{x}=R\mathbf{Lu}$ of a sphere, where $\mathbf{L}$ is a lower triangular matrix and $\mathbf{u}$ is a unit vector, i.e. $\mathbf{u}^T\mathbf{u}=\mathbf{1}$, with elements
$$ u_1=\cos(ϕ_1) $$ $$ u_2=\sin(ϕ_1)\cos(ϕ_2) $$ $$ u_3=\sin(ϕ_1)\sin(ϕ_2)\cos(ϕ_3) $$ $$\vdots$$ $$ u_k=u_{k-1}\tan(ϕ_{k-1})\cos(ϕ_k) $$ $$ u_n=u_{n-1}\tan(ϕ_{n-1}) $$
and the angles $ϕ_{1}, ϕ_{2}, \dots, ϕ_{n-2}$ range over $[0, π]$ and $ϕ_{n−1}$ ranges over $[0, 2π]$.
My thinking is to do the following:
1) Find the expression for gradient of the second surface $\frac{dS_2}{d\mathbf{x}}$, which is an $n \times 1$ column vector
2) Substitute the expression for the ellipsoid into the gradient from (1), i.e. $\frac{dS_2}{d\mathbf{x}} |_{\mathbf{x}=R\mathbf{Lu}}$
3) Find the expression for the tangent plane to the ellipsoid as $R\frac{d\mathbf{Lu}}{d\mathbf{\phi}}$, which is a $(n-1)\times n$ matrix (using the denominator layout for vector derivative)
4) Set the product of the gradient from (2) and the tangent plane from (3) eual to $\mathbf{0}$, i.e. $(R\frac{d\mathbf{Lu}}{d\mathbf{\phi}})(\frac{dS_2}{d\mathbf{x}} |_{\mathbf{x}=R\mathbf{Lu}})=\mathbf{0}$, which gives a system of $n-1$ equations for $ϕ_{1}, \dots, ϕ_{n-1}$.
This approach, however, (assuming it is correct) seems to be rather laborious and I was wondering if there is a better way of doing it.
For two surfaces to touch at $X=(x_1,\dots, x_n)$ you need $S_1=S_2$ and $\nabla S_1=\lambda\nabla S_2$ at $X$. This is a system of $n+1$ equations in the $n+1$ unknowns $(x_1,\dots, x_n, \lambda)$.