I am trying to optimize $f(x,y)=x+2y+\frac{x^2y^2}{(2)10^8}$ with constraint $2000=5x+10y$ I know that the $\bigtriangledown$$f$$=$$(1+$$\frac{xy^2}{10^8}$,$2+$$\frac{x^2y}{10^8}$) and that $\bigtriangledown$g$=(5,10)$. That must mean that: $1+$$\frac{xy^2}{10^8}$=$\lambda$5 and that $2+$$\frac{x^2y}{10^8}$=$\lambda$10. Where do I go from here?
Stuck using lagrange multipliers
94 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 4 best solutions below
On
I'm not sure why it seems to work, but there seems to be a shortcut to Lagrange multiplier problems. If your constraint is of the form $Ax+By+Cz+..=F$, you can often get the solution just by having $Ax=F$ and all the other coordinate values be $0$, or solve for $Ax=By=Cz=...$ that solvest the constraint. I suspect it will always work when both objective function and constraint function are convex.
Note in your case we have $5x+10y=2000$. Applying the above principle we would get:
$5x=2000,y=0\implies x=400$
$x=0,10y=2000\implies y=200 $
$5x=10y=2000\implies 5x=1000\implies x=400$ and $y=200$.
The solutions you get with all the algebra.
UPDATE I'm not sure when exactly this works. It works in the given problem, it works if you want to find the side lengths of the rectangle with minimum area given a constant perimeter. It fails in the counter example given in the comments.
I suspect it might require a symmetry in the target function. I notice part of the target function is a constant multiple of the constraint function. Ignore that part, and what remains is symmetric under swapping of the independent variables. I need to think of a formal proof.
On
You can avoid the Lagrange multiplier method. First observe that $x+2y=400,$ hence $$f(x,y)=400+ {(2x y)^2\over 8\times 10^8}.$$ The least value of $f(x,y)$ is equal $400$ and is attained for $x=0$ or $y=0.$ The maximum is attained when $2x=y,$ i.e. $x=200$ and $y=100.$ This follows from the fact that the maximal value of the product $ab,$ when the sum $a+b$ is fixed, is attained for $a=b.$ Apply that to $a=x$ and $b=2y.$
On
The level-curves for the function $$ f(x,y) \ \ = \ \ x \ + \ 2y \ + \ \frac{x^2y^2}{ 2·10^8} $$ have a rather interesting behavior, which we can examine using a "toy" version, $ \ ax + by + \frac{x^2·y^2}{2} \ = \ c \ \ . $
The curve equation using the last term alone, $ \ \frac{x^2·y^2}{2} \ = \ c \ \ , $ has "four-fold symmetry" about the origin, with the section in each quadrant having the coordinate axes as asymptotes for any finite value of $ \ c \ \ , $ since it is of course equivalent to $ \ y \ = \ \pm \frac{\sqrt{2c}}{x} \ \ , $ the union of two rectangular hyperbolas. Adding the linear terms $ \ ax + by \ $ to this expression, however, "caps off" the curve on the coordinate axes at the points $ \ \left(\frac{c}{a} \ , \ 0 \right) \ $ and $ \ \left(0 \ , \ \frac{c}{b} \right) \ \ ; \ $ there are still "infinite tails" in the opposite directions along the axes and the original symmetry is thus "broken".
If a linear constraint $ \ kax + kby \ = \ D \ \ $ is applied then, these coordinate-axis intercepts will lie on that line. This gives us an extremal value for the function $$ a·\frac{c}{a} \ + \ 0 \ + \ 0 \ \ = \ \ 0 \ + \ b·\frac{c}{b} \ + \ 0 \ \ = \ \ \frac{D}{k} \ \ . $$
For our toy function, we see in the graph above that the constraint line (in red) $ \ 5x + 10y \ = \ 100 \ \ [k = 5 \ , \ D = 100] \ $ is met by the level-curve for $ \ c \ = \ \frac{100}{5} \ = \ 20 \ $ at the points $ \ \left(\frac{20}{1} = 20 \ , \ 0 \right) \ $ and $ \ \left(0 \ , \ \frac{20}{2} = 10 \right) \ \ . $ With the given function $ \ f(x,y) \ \ = \ \ x \ + \ 2y \ + \ \frac{x^2y^2}{ 2·10^8} \ $ and the constraint $ \ 5x + 10y \ = \ 2000 \ $ in the problem then, we have $ \ k \ = \ 5 \ $ and $ \ D \ = \ 2000 \ \ , $ so this extremal value for the function occurs at $$ \mathbf{f \left(\frac{D/k}{a} \ = \ 400 \ , 0 \right) \ \ = \ \ f \left( 0 \ , \ \frac{D/k}{b} \ = \ 200 \right) \ \ =} \ \ \frac{D}{k} \ \ = \ \ \mathbf{400} \ \ . $$
The other extremum occurs in the situation where an arc of the quasi-hyperbola is tangent to the constraint line, which has a slope given by $ \ kax + kby \ = \ D \ \Rightarrow \ y \ = \ \frac{D}{kb} - \ \frac{ka}{kb}·x \ \Rightarrow \ m \ = \ -\frac{a}{b} \ \ . $ By implicit differentiation, our function curve has derivative $ \ y' \ $ found from $$ a·1 \ + \ b·y' \ + \ \frac{2·x ·y^2}{2} \ + \ \frac{2·x^2·y·y'}{2} \ \ = \ \ 0 \ \ ; $$ the derivative is equal to the slope of the constraint line for $$ a \ + \ b·\left(-\frac{a}{b} \right) \ + \ x ·y^2 \ + \ x^2·y·\left(-\frac{a}{b} \right) \ \ = \ \ 0 \ \ \Rightarrow \ \ a \ - \ a \ + \ x ·y^2 \ - \ \frac{a}{b}·x^2·y \ \ = \ \ 0 $$ $$ \Rightarrow \ \ x ·y· \left(y \ - \ \frac{a}{b}·x \right) \ \ = \ \ 0 \ \ . $$ [Note that this is the generalization of what José Carlos Santos finds from the Lagrange-multiplier calculation.]
For the toy function and the function in our problem, with $ \ a \ = \ 1 \ \ , \ \ b \ = \ 2 \ \ , $ the factor $ \ y \ - \ \frac{a}{b}·x \ = \ 0 \ $ gives us the equation of a line $ \ y \ = \ \frac12·x \ \ $ [the orange line]. In the toy example, this intersects the constraint line (and the level-curve) at $ \ 5·(2y) + 10y \ = \ 100 \ \Rightarrow \ y \ = \ 5 \ \ , \ \ x \ = \ 10 \ \ , $ corresponding to the function value $$ 10 \ + \ 2·5 \ + \ \frac{10^2 \ · \ 5^2}{ 2 } \ \ = \ \ 10 \ + \ 10 \ + \ \frac{2500}{2} \ \ = \ \ 1270 \ \ . $$
At last, the function under discussion has this extremum occur at $ \ 5·(2y) + 10y \ = \ 2000 \ \Rightarrow \ (200,100) \ \ , $ giving us what is the maximal value for the function, $$ \ \mathbf{f(200 \ , \ 100) \ \ =} \ \ 200 \ + \ 2·100 \ + \ \frac{200^2 \ · \ 100^2}{2·10^8} \ \ = \ \ 200 \ + \ 200 \ + \ \frac{4·10^4 \ · \ 1·10^4}{2·10^8} \ \ = \ \ \mathbf{402} \ \ . $$ The other extremum we found above is thus the minimal function value of 400.

Since$$1+\frac{xy^2}{10^8}=5\lambda\quad\text{and}\quad2+\frac{x^2y}{10^8}=10\lambda,$$you have$$2\left(1+\frac{xy^2}{10^8}\right)-\left(2+\frac{x^2y}{10^8}\right)=0.$$In other words, $xy(2y-x)=0$, and therefore $x=0$, $y=0$ or $x=2y$. And you also have $5x+10y=2000$. So, the solutions are $(x,y)=(400,0)$, $(x,y)=(0,200)$, and $(x,y)=(200,100)$.