Introduction
A point outside an ellipsoid has a natural nearest point on its surface. Finding that point is not simply a matter of moving toward the ellipsoid’s center: the direction of shortest distance depends on the ellipsoid’s shape. The same problem can be more subtle when the given point is inside the ellipsoid, because there may be several equally close points on the surface.
The method is to minimize squared distance subject to the ellipsoid equation. Lagrange multipliers produce candidate points, but the multiplier equations must be handled carefully: some values make a commonly used formula undefined, and a stationary point is not automatically the nearest point. The geometry of the ellipsoid provides a useful way to check candidates.
Setting Up the Problem
Consider an ellipsoid in \(n\)-dimensional space, centered at the origin and aligned with the coordinate axes. Let its positive semiaxis lengths be \(a_1,\dots,a_n\), and let the given point be \(\mathbf{p}=(p_1,\dots,p_n)\). A point \(\mathbf{x}=(x_1,\dots,x_n)\) lies on the ellipsoid when
The squared distance from \(\mathbf{x}\) to \(\mathbf{p}\) is \(\sum_{i=1}^n(x_i-p_i)^2\). Minimizing this is equivalent to minimizing half the squared distance; the factor of one half makes the derivatives simpler.
The ellipsoid is closed and bounded, so it is compact. The squared-distance function is continuous, so it attains a minimum on the ellipsoid. Moreover, its constraint is regular everywhere on the ellipsoid: its gradient is
This gradient can vanish only when every \(x_i=0\), but the origin does not lie on the ellipsoid. Therefore, the Lagrange multiplier condition applies at every constrained minimum.
The Multiplier Equations
Minimize \(F(\mathbf{x})=\frac12\sum_{i=1}^n(x_i-p_i)^2\) subject to \(g(\mathbf{x})=0\). With the convention \(\nabla F+\lambda\nabla g=\mathbf{0}\), the coordinate equations are
Whenever \(a_i^2+\lambda\neq 0\), each equation can be rearranged to give
Substituting these coordinates into the ellipsoid equation gives a one-variable equation for the multiplier:
Solving this equation gives candidate multipliers, and the coordinate formula then gives candidate points. But the formula is valid only when none of its denominators is zero. If \(\lambda=-a_j^2\), the \(j\)-th multiplier equation instead reads \(-p_j=0\). Thus this multiplier value is possible only if \(p_j=0\); when it is possible, that equation does not determine \(x_j\). Such cases must be checked in the original equations and the ellipsoid constraint rather than discarded.
Why the Normal Direction Gives a Geometric Check
The multiplier equations say that the vector from the candidate point on the ellipsoid to the given point is a scalar multiple of the ellipsoid’s normal vector:
This normal-direction condition is necessary for a closest point, but by itself it does not say whether the point is closest or farthest. For this ellipsoid, the constraint equation gives a sharper check when \(\lambda\geq 0\).
To prove this, write \(\Delta_i=y_i-x_i\). Because both points satisfy the ellipsoid equation, subtracting \(g(\mathbf{x})=0\) from \(g(\mathbf{y})=0\) gives
Consequently, \(\nabla g(\mathbf{x})\mathbin{\cdot}(\mathbf{y}-\mathbf{x})=-\sum_i\Delta_i^2/a_i^2\). Now expand the squared distance from \(\mathbf{p}\) to \(\mathbf{y}\), using \(\mathbf{p}-\mathbf{x}=\lambda\nabla g(\mathbf{x})\):
The inequality follows because \(\lambda\geq0\) and every squared term is nonnegative. It holds for every point \(\mathbf{y}\) on the ellipsoid, proving the claim. If \(\lambda>0\), equality is possible only when every \(\Delta_i=0\), so the closest point is unique. For \(\lambda<0\), this argument does not establish a minimum; compare the candidates.
Worked Example: An Exterior Point and a Global Check
Worked Example: An Exterior Point and a Global Check
Find the closest point on the ellipse \(\frac{x^2}{9}+\frac{y^2}{4}=1\) to \(\mathbf{p}=(11/5,12/5)\). A candidate is \(\mathbf{x}=(9/5,8/5)\). First check that it is feasible:
Here \(g(x,y)=x^2/9+y^2/4-1\), so \(\nabla g(x,y)=(2x/9,y/2)\). At the proposed point,
Thus \(\mathbf{p}-\mathbf{x}=1\cdot\nabla g(\mathbf{x})\), so the multiplier is \(\lambda=1\). The geometric verification applies because \(\lambda\geq0\): this point is globally closest on the ellipse. Its squared distance is
The distance is therefore \(\sqrt{4/5}=2/\sqrt{5}\). The feasibility check and the normal-direction check both agree with the candidate.
Worked Example: The Center of an Ellipse
Worked Example: The Center of an Ellipse
Find the closest points on \(\frac{x^2}{9}+y^2=1\) to the origin. On the ellipse, \(x^2/9+y^2=1\), so \(x^2=9(1-y^2)\). The squared distance to the origin is therefore
Since \(0\leq y^2\leq1\), this quantity is minimized when \(y^2=1\). The constraint then gives \(x=0\), so the two closest points are \((0,1)\) and \((0,-1)\), each at distance \(1\).
The multiplier equations confirm why the usual coordinate formula needs care. With \(\mathbf{p}=(0,0)\), they are
At either closest point, \(x=0\), \(y=\pm1\), and \(\lambda=-1\). The second equation is then \(0=0\); it does not determine \(y\). The ellipsoid constraint gives \(y=\pm1\), and substituting either point back gives squared distance \(0^2+(\pm1)^2=1\), as required.
Worked Example: An Interior Point and a Singular Multiplier
Worked Example: An Interior Point and a Singular Multiplier
Find the closest points on \(\frac{x^2}{4}+y^2=1\) to \(\mathbf{p}=(1,0)\). The multiplier equations are
First consider \(\lambda\neq-1\). The second equation gives \(y=0\). The constraint then gives \(x^2/4=1\), so \(x=2\) or \(x=-2\). Substituting \(x=2\) into the first equation gives \(1+\lambda/2=0\), hence \(\lambda=-2\). Substituting \(x=-2\) gives \(-3-\lambda/2=0\), hence \(\lambda=-6\). Their squared distances from \((1,0)\) are respectively \(1\) and \(9\).
Now check the exceptional value \(\lambda=-1\) in the original equations. The first equation becomes \(3x/4-1=0\), so \(x=4/3\). The constraint gives
The two resulting candidates are \((4/3,\sqrt{5}/3)\) and \((4/3,-\sqrt{5}/3)\). For each one, substitution into the constraint gives \(4/9+5/9=1\). Its squared distance from \((1,0)\) is
The stationary candidates found are \((2,0)\), \((-2,0)\), and the two points with \(x=4/3\). Their squared distances are \(1\), \(9\), and \(2/3\), respectively. Because a minimum exists and every minimum must satisfy the multiplier equations, the least of these candidate distances identifies the global minima. Both points \((4/3,\pm\sqrt{5}/3)\) are closest, each at distance \(\sqrt{2/3}\).
A Common Mistake: Dividing by a Zero Factor
In the interior-point example, it would be incorrect to divide the second multiplier equation \((1+\lambda)y=0\) by \(1+\lambda\) without first checking whether that factor can be zero. Doing so would force \(y=0\), leave only \((2,0)\) and \((-2,0)\), and incorrectly declare \((2,0)\) closest because its distance \(1\) is less than \(3\). The omitted multiplier \(\lambda=-1\) gives two feasible points at distance \(\sqrt{2/3}<1\).
A Reliable Procedure
For a specified axis-aligned ellipsoid and target point, the following process keeps the algebra and the geometric check distinct.
Minimize half the squared distance to the target, subject to the ellipsoid equation.
Use \(x_i-p_i+\lambda x_i/a_i^2=0\) for each coordinate.
Do not use the coordinate formula where \(a_i^2+\lambda=0\); return to the original equations there.
Substitute every candidate into the ellipsoid equation, then compare its squared distance to the target.
If a candidate has \(\lambda\geq0\), the squared-distance identity proves it is globally closest.
The method matters in geometry and design whenever a point must be placed on a curved boundary as close as possible to a specified location. It also illustrates a general lesson in constrained optimization: the equations locate candidates, while feasibility and comparison establish which candidate solves the original problem.
Check Your Understanding
Use the multiplier equations and the ellipsoid geometry to answer these questions.
- Why is minimizing half the squared distance equivalent to minimizing the distance itself?
- For an ellipsoid with semiaxes \(a_i\), what scalar equation follows when the coordinate formula is valid?
- Why must the cases \(a_i^2+\lambda=0\) be checked in the original multiplier equations?
- What does the sign condition \(\lambda\geq0\) allow you to conclude from the distance comparison identity?
- In the ellipse \(\frac{x^2}{4}+y^2=1\), why are there two closest points to \((1,0)\), and what is their common distance?