Lagrangian with two nonzero constraints

329 Views Asked by At

Determine the maximum value of $OP$, $O$ being the origin and $P$ being a point on the curve defined by $x^2+y^2-2z^2=5$ and $x+2y+z=5$.

I am using Lagrangian multipliers $\lambda$ and $\mu$. I have done problems in which one of the constraints goes to zero. Here both are non-zero. How will we eliminate them from the differential equation?

3

There are 3 best solutions below

0
On BEST ANSWER

Grit your teeth and grind through the solution. It’s really not all that involved and requires at worst solving a simple quadratic equation. Besides the two constraints, you have the equations $$2x-2\lambda x -\mu = 0 \\ 2y-2\lambda y-2\mu = 0 \\ 2z+4\lambda z - \mu = 0.$$ You should be able to see at a glance that $\mu$ can be eliminated by forming various linear combinations of these equations. For example, if you subtract twice the first from the second, the result factors nicely into $$2(2x-y)(\lambda-1) = 0.$$ Now you have two possibilities to pursue. Back-substitute each in turn into your system of equations and continue solving. (It turns out that one of these two paths leads to $\mu=0$. One of the multipliers vanishes after all.)

3
On

Guide:

We can convert $x^2+y^2-2z^2=5$ to $x^2+y^2-2z^2-5=0$. Let $g_1(x,y,z)=x^2+y^2-2z^2-5$.

Perform similar trick for the second constraint.

Hence now, you have reduced the problem to an expression that you are familiar with $$\max_{x,y,z} f(x)$$ subject to $$g_1(x,y,z)=0$$ $$g_2(x,y,z)=0.$$

1
On

Computers were invented for a reason! Using SymPy to solve the system of polynomial equations:

from sympy import *

x, y, z, mu1, mu2 = symbols('x y z mu1 mu2', real=True)

# define Lagrangian
L = (x**2 + y**2 + z**2) - mu1 * (x**2 + y**2 - 2*z**2 - 5) - mu2 * (x + 2*y + z - 5)

# compute partial derivatives
partials = [ diff(L,var) for var in [x, y, z, mu1, mu2] ]

# find where partial derivatives vanish
print solve_poly_system(partials, x, y, z, mu1, mu2)

This script outputs the following list of solutions.

[(1, 2, 0, 1, 0), (11/9, 22/9, -10/9, -7/3, 220/27)]

Plotting the hyperboloid, the plane, and points $(1, 2, 0)$ and $\left( \frac{11}{9}, \frac{22}{9}, -\frac{10}{9} \right)$, we have

enter image description here