Lagrange multiplier method - cannot resolve equations but graphically I have the answer

100 Views Asked by At

My problem is similar to this: Intuitive explanation for formula of maximum length of a pipe moving around a corner?

However my pipe (20m long) must pass through a specific point (5,5) in the X-Y plane and the question is then how high up the wall can it reach? - see diagram below. Diagram to explain setup

So my equations are $x^2 + y^2 = 400$ (function F) and the constraint can be written as $(x-5)(y-5) = 25$ (function G). This second equation is seen via above diagram as $tan(\theta) = x/y$ and also $tan(\theta)= 5/(y-5)$ and $tan(\theta)= (x-5)/5$ by similar triangles.

I use $ L = F - \lambda(G) $.

$ L = x^2 + y^2 - 20^2 - \lambda((x-5)(y-5)-25) $

So $\partial L_x = 2x - \lambda(y-5) = 0 $ Eqn1.

and $\partial L_y = 2y - \lambda(x-5) = 0 $ Eqn2

I then multiply Eqn1 by y and Eqn2 by x and subtract Eqn2 from Eqn1 and I cannot proceed from there. Below is a graph I did that shows the solution (6.811,18.805) for x and y, but I would like to be able to solve it via Lagrange multiplier. Thanks in advance for any clues Graph of the 2 Equations

1

There are 1 best solutions below

4
On

It is good that you want to make up a new problem and solve it. It is also good that you refer to the existing problem. Later on you can consider more difficult Moving sofa problem.

Now speaking of your problem, you need to clarify what you want to optimize. This is the question you pose:

the question is then how high up the wall can it reach?

It looks you want to maximize $y$ subject to two constraints: $$\begin{cases} x^2 + y^2 = 400 \ \ \ \ \ \ \ \ \ \ \ \text{(the pipe ends must touch the ground and the wall} \\ (x-5)(y-5) = 25 \ \ \text{(must pass through $(5,5)$)} \end{cases}$$

The thing is you can solve the two constraints as a system and find $(x,y)=(6.8; 18.8), (18.8; 6.8)$. And choose $y=18.8$ as a maximum.

See the only two choices (other lines will not satisfy both constraints):

$\hspace{3cm}$enter image description here

If you insist on solving the problem with Lagrange multiplier, then the Lagrange function is: $$L(x,y,\lambda_1,\lambda_2)=y+\lambda_1(400-x^2-y^2)+\lambda_2(25-(x-5)(y-5)).$$

Now you can set partial derivatives equal to zero and find $(x,y)$. Note that when you take partial derivatives w.r.t. $\lambda_1$ and $\lambda_2$, you will anyway get the system of two equations mentioned above, which produces the two solutions.