[Math] Shortest and Longest Distance from the Origin and an Ellipse Using Lagrange Multipliers

calculuslagrange multipliermultivariable-calculus

I am stuck on this problem. The function of the ellipse is given by

$g(x,y)=17x^2 + 12xy + 8y^2$

I know that this is our constraint and we can use

$f(x,y) = x^2 + y^2$

as what we want to maximize and minimize. So:

$f_x = 2x$

$f_y= 2y$

$g_x=34x+12y$

$g_y=12x+16y$

Using lagrange multipliers we get:

$2x = λ (34x+12y)$

$2y = λ (12x +16y)$

After this I am unsure what to do. My best guess was to multiply each side by the variable they are missing so you can set them equal to each other and pull out a variable.

$2xy = y(34x+12y) = x(12x+16y)$

Then find when:

$34x+12y = 0$

and

$12x+16y = 0$

but this does not work.

Best Answer

The constraint in problems like these is usually given as a level curve of some function. We’ll proceed assuming that this is the case here, i.e., that the constraint is of the form $g(x,y)=c^2$, with $c>0$.

After differentiating and introducing a Langrange multiplier, you have a system of three equations in three unknowns:$$\begin{equation} 2x = λ (34x+12y) \\ 2y = λ (12x +16y) \\ 17x^2 + 12xy + 8y^2 = c^2 \end{equation}$$ Solve for $\lambda$ in one of them, say, the first, and substitute into the other one:$$ \lambda = \frac x {17x+6y} \\ 2y=\frac{12x^2+16xy}{17x+6y}. $$ Solve this new equation for $y$:$$ 34xy+12y^2=12x^2+16xy \\ y = \frac x2, -2x. $$ Plugging either of these values into $g(x,y)=c^2$ yields $x^2=\frac{c^2}{25}$. So, you have the following two pairs of points as the candidates for extrema: $\left(\frac15c,\frac1{10}c\right)$, $\left(-\frac15c,-\frac1{10}c\right)$ and $\left(\frac15c,-\frac25c\right)$, $\left(-\frac15c,\frac25c\right)$, with distances from the origin of $\frac1{2\sqrt5}c$ and $\frac1{\sqrt5}c$, respectively. I’ll leave verifying that these are minima and maxima to you.

Solving for $\lambda$ in the second equation and substituting into the first yields $x=2y,-\frac y2$, which doesn’t produce any additional solutions to the system.


To check the solution, note that the level curves of $g$ are a family of ellipses centered on the origin, so the given problem is equivalent to determining the semimajor and semiminor axes of these ellipses. As a quadratic form, $g$ is represented by the matrix $$ \pmatrix{17 & 6 \\ 6 & 8} $$ which has eigenvalues $20$ and $5$, with eigenvectors $\langle2,1\rangle$ and $\langle-1,2\rangle$, respectively. The semiminor axis is in the direction of the eigenvector corresponding to the larger eigenvalue, and the semimajor axis is orthogonal to it, in the direction of the other eigenvector. The ratio of the eigenvalues is the square of the ratio of the ellipse’s axis lengths, all of which matches the solution above.

level curves

Curiously, if you compute the numerical values of $\lambda$ above, they turn out to be the reciprocals of the eigenvalues.