Using Lagrange multipliers to maximize a function subject to a constraint, but I can only find a minimum.

229 Views Asked by At

This was a question on my test that I got two points taken off for because I wrote my answer as a minimum when the question asks for a maximum. The thing is that I'm pretty confident the maximum DNE, but I already asked my teacher about it once, so I just would like someone else to prove me right or wrong before I bother her again.


Question: Assume $x>0, y>0$. Use Lagrange multipliers to maximize $f(x,y) = \sqrt{x^2+y^2}$ subject to the constraint $2x+4y=15$.


My solution: First I set $g(x,y) = 2x+4y-15=0$ and found the gradient of both functions $$f_x(x,y)=\frac{x}{\sqrt{x^2+y^2}}, g_x(x,y)=2$$ $$f_y(x,y)=\frac{y}{\sqrt{x^2+y^2}},g_y(x,y)=4$$ I then used Lagrange multipliers to find $x$ and $y$ where $f_x(x,y)=\lambda g_x(x,y)$ and $f_y(x,y)=\lambda g_y(x,y)$ $$\frac{x}{\sqrt{x^2+y^2}}=\lambda 2$$ $$\lambda=\frac{x}{2\sqrt{x^2+y^2}}$$ $$\frac{y}{\sqrt{x^2+y^2}}=\lambda 4$$ $$\frac{y}{\sqrt{x^2+y^2}}=\frac{4x}{2\sqrt{x^2+y^2}}$$ $$y=2x$$ Putting that into the constraint $2x+4y=15$, you get $y+4y=15$, so $y=3$ and $x=\frac{3}{2}$. Therefore $f(\frac{3}{2},3)=\frac{\sqrt{45}}{2} \approx 3.35$. That's the answer my professor gave us as a maximum but I'm pretty sure that's the minimum. If you pick any other $x$ and $y$ that fit the constraint and plug it into $f(x,y)$, you get a larger number. For example, if $x=1$ then $y=\frac{13}{4}$. Plugging those into $f(x,y)$, you get $f(1,\frac{13}{4}) \approx 3.40$ which is larger than the "maximum". I also used a 3d graphing utility to find the intersect of $f(x,y)$ and $g(x,y)$, which comes out at a positive parabola. I also found the exact problem as an exercise in the textbook except it asks for the minimum instead. I know this is a bit of an overreaction considering it's only worth 2 points, but I just need someone to tell me I'm not crazy lol.

2

There are 2 best solutions below

0
On

well.....................................The minimum occurs at the red dot. The maximum occurs along the $x$ axis, where the purple circle meets the red line, at $x = \frac{15}{2}$ and $y=0.$ If the question lacked the inequalities $x \geq 0, y \geq 0$ there would be no maximum $$ $$ enter image description here

0
On

The lagrangian

$$ L(x,y,\lambda) = \sqrt{x^2+y^2}+\lambda(2x+4y-15) $$

The stationary conditions

$$ \nabla L = 0 = \cases{\frac{2x}{2\sqrt{x^2+y^2}}+2\lambda \\ \frac{2y}{2\sqrt{x^2+y^2}}+4\lambda\\ 2x+4y-15 } $$

As $\lambda$ is a generic multiplier we can recast it as $\Lambda = 2\sqrt{x^2+y^2}\lambda$ and then

$$ \cases{ x + \Lambda = 0\\ y + 2\Lambda = 0 } $$

After substitution into the constraint we have $\Lambda = -\frac 32$ so the stationary point is at $x = \frac 32, y = 3$. To qualify the kind of stationariness, at the constraint we have

$$ f(x,y(x)) = g(x) = \sqrt{x^2+\left(\frac{15-2x}{4}\right)^2} $$ Under the square root symbol, there is a parabola $$\frac{5}{16} \left(4 x^2-12 x+45\right)$$ which has a minimum at $x = \frac 32$