CAL 3 Problem
Solve using Lagrange Multipliers Find the critical points of \[f(x.y)= x^2+y^2\] on the curve \[xy-x-y=1\]
\[f=x^2+y^2\\g=xy-x-y\] we first set up the Lagrange equation system: \[ f_x=\lambda g_x\\ f_y=\lambda g_y\\ g=1 \]
so, \[ \rm(1)\qquad2x=\lambda(y-1)\\ \rm(2)\qquad2y=\lambda(x-1)\\ \rm(3)\qquad x(y-1)-y=1 \]
solve these equations using either matrix method or by eliminations
eq(1)-eq(2) \[2(x-y)=\lambda[(y-1)-(x-1)]\\ 2\cancel{(x-y)}=-\lambda\cancel{(x-y)}\\ \implies\lambda=-2 \]
so, \[2x=-2(y-1)\qquad 2y=-2(x-1)\\ x=1-y\qquad\qquad\quad y=1-x\]
there are no stationary points!!!
I believe it was simplified. if you distribute it you'll get the equation of the curve
the third equation is the derivative with respect to \(\lambda\) \[L(x,y,\lambda)=f(x,y)-\lambda[g(x,y)-c]\]
so, \[0=g(x,y)-c\\\implies g(x,y)=c\]
was lambda was made negative because you get \[2(x-y)=\lambda[(y-1)-(x-1)] \rightarrow 2(x-y)=\lambda[(y-x)]\]
you can have it either way.. you'd end up with the same thig.. lambda is just an arbitrary scalar
also, in the step where I cancel off the (x-y) term, I do that "understanding" that under the given conditions, \(x\ne y\)
kapeesh all?
@camoJAX the extracting "-" sign, yes thats why I did that
ohh ok now i gotcha
@hoa i was very confused when i was given this problem
ok, so my frist post declares the three differntial equations.
1) partial diff with x 2) partial diff with y 3) partial diff with lambda -> gives you the criterion equation...
these equations can be readily obtained using the expression for "L(x,y,lambda)" I gave earlier
is (3) a general equation?
no (3) is the constraint for optimization.. specific for each problem
L(x,y,lambda) is the Lagrangian function. this function combines (linearly) the cost function (f) with the constraint (g=c)
ok, from top,.. cost function: \(f(x,y)\) constraint:\(g(x,y)=c\)
@Hoa perfect... so, now, do you get any values for "x" and "y"?
no.. so, no solution exists
back we then combine the cost function and the constraint using a linear relationship \[L(x,y,\lambda)=f(x,y)-\lambda\left[g(x,y)-c\right]\]
ohh okay i understand now
now, this function represents the "function with the constyraint"
@Hoa "x=y" can be satisfied by infinite values.. and is not possible so, no solution
this Lagrangian manifests as a Hamiltonian in the applications esp., Quantum mechanics
please elaborate
@Hoa lol. then ignore that piece
well, if you want, try to replace all "x" in g(x,y)=c with "y" and what do you get?
so the critical points are x=1-y y=1-x
@electrokid
@camoJAX He ran away. just you and me for the topic , now. review. he said that L (x,y,lamda) = f(x,y ) - lamda[g (x,y)-c] and then take derivative to get (3). I never know about that, but temporarily accept the formula to step up. But, when take derivative respect to lamda of that L, I got something with negative sign, like -[ (x(y-1)-y) -1] and cannot be like what he said.
what do you think? let him go, I feel embarrass when I waste other's time with my stupidity.
ok, after changing the side, I got what he said.
my bad i stepped away, i was lost with that one too but now i get it also
@Hoa and @camojax the derivatives should equal zero since, when f(x,y) is maxima or minima, L has an extrema too
@camoJAX check with the \(\mathcal{L}\) function and its partial derivative with respect to \(\lambda\)
that should give you the (3) equation.
\[L(x,y,\lambda)=x^2+y^2-\lambda xy+\lambda x+\lambda y+\lambda\] \[\frac{ \partial L }{ \partial \lambda } L(x,y,\lambda)=-x(y-1)+y+1\] @electrokid I did not get the same result as you did for (3)
and this should become =0 since we are looking for an extrema..
ok, thanks
surething
actually, the so-called L(x,y,lamda) is exactly the constraint. kid confused me,A ha!
"L" is a linear combination of the function to maximize/minimize and the constraints on the optimization. so, L becomes your new cost function that implicitly optimizes cost "f" under constraint "g"
you are very good at foundation of math. good kid
@Hoa thank you. that is the only way I can stay "sane".
@Hoa @camoJAX this linear combination is performed along a new "dimension of \(\lambda\)". that is why we have to optimize along all the dimensions (dimensions of "f" and "g" and the new one, lambda)
got it. sir
Join our real-time social learning platform and learn together with your friends!