Find the shortest distance of the curve $\frac{(x-3)^2}{4}+\frac{(y-1)^2}{9}=1$ from the origin

analytic geometrycalculuscoordinate systemsoptimizationsecond-order-cone-programming

https://math.stackexchange.com/a/185627

Referring to the methods mentioned in this answer, after trying the first method I got a term that looked like this:

$$\sqrt{14 + 5\sin^2{\theta} + 6\sin{\theta} + 12\cos{\theta}}$$

Which was rather difficult to find a minima of, algebraically.

Using a common method, i.e. the shortest distance of a point from a curve lies along its common normal line.

I ended up with an equation,
$$2 \sec{\theta} – 9 \csc{\theta} = 5$$

Which was again rather difficult to solve algebraically.

Can someone please help me solve the above equations, or solve the question with an alternate solution?

Best Answer

I will copy what I wrote in comments as an answer.

You can look at this as the problem of minimizing $f(x,y) = x^2+y^2$ with constraint $g(x,y) = \frac{(x-3)^2}{4}+\frac{(y-1)^2}{9}-1 = 0$. This falls down onto the territory of Lagrange multiplier. Calculating gradients gives us $\nabla f(x,y) = (2x,2y)$ and $\nabla g(x,y) = \left(\frac 12(x-3), \frac 29(y-1)\right)$ which need to be colinear, so we get system \begin{align} \lambda(x-3) &= 4x\\ \lambda(y-1) &= 9y \end{align} and eliminating $\lambda$ gives us $ y= \frac{4x}{27-5x}$. We can substitute that into the constraint $g(x,y) = 0$ which then simplifies to finding the roots of quartic $25 x^4 - 420 x^3 + 2510 x^2 - 5940 x + 3969$.

In theory, quartics are solvable by radicals, so it's possible to obtain explicit solution, or you can use numerical methods, depending on what you are looking for. For example, you could use Durand–Kerner method.

It turns out that we have two real solutions $x_1≈1.0727$, $x_2≈4.3306$, minimum being obtained by $x_1$, which you can verify from bordered Hessian. In this case, it boils down to calculating determinant of the bordered Hessian.

The value of $f(x,y)$ for $x = x_1$, $y = \frac{4x_1}{27-5x_1}$ is approximately $1.19001$, so the required distance is the square root of that, which is approximately $1.09088$.

You can convice yourself of the correctness of the result by looking at the following plot.