The method of Lagrange Multiplier ! Optimize multivariate functions.

Yesterday I learned the beautiful method of Lagrange Multiplier, to find the minima or maxima of multivariate functions. eg

If I ask you what’s the minimum value of a function, f(x,y) = xy, subject to the constraint 5x-y = 4, the answer would be -4/5. The method is this. Ensure that first-partials of function f(x,y) exist. That is fx = (∂f)/(∂x) is not zero, and fy = (∂f)/(∂y) is not zero. Else method won’t work.

For the given example the f(x,y) = xy, because fx = y and fy = x, our method will work.

According to the method, we have 3 equations:

(1) fx + λgx = 0

(2) fy + λgy = 0

(3) 5x − y = 4

We already know what are fx and fy, right? We already evaluated them in this example; fx = y and fy = x. But what’s λ? Its called Lagrange “undetermined” multiplier. It need not be determined from above 3 equations, for determining extrema. (minima and maxima) …

Note that 3 unknowns (x, y, λ) and 3 equations (1, 2, 3) are there. Also g is the constraint function, from the constraint equation: 5x – y = 4, when g(x,y) = 0. So let’s evaluate everything to find the minima.

As we have already seen, fx = (∂f)/(∂x), so since f = xy, fx = y. Similarly fy = x. (very simple derivatives)

Now gx = (∂g)/(∂x) = (∂(5x − y − 4))/(∂x) = 5 .

Similarly gy = (∂g)/(∂y) = (∂(5x − y − 4))/(∂y) =  − 1.

So 1, 2, 3 becomes:

(4) y + 5λ = 0

(5) x − λ = 0

(6) 5x − y = 4

We have 3 equations, 4, 5 and 6, and 3 unknowns, x, y, λ. Lets solve for x, y.

From 4 and 5,

(7) y + 5x = 0

and 5x − y = 4

So, 2y =  − 4 or y =  − 2. So x = (4 + y) ⁄ 5 = 2 ⁄ 5.

So f(x, y)minima = x*y =  − 2*2 ⁄ 5 =  − 4 ⁄ 5.

QED.

PS: The method can easily be extended to more variables, with x, y, z we will have 4 unknowns x, y, z, λ and 4 equations, involving them. For more than one constraint equation, we simply add over the constraint part in the above equations, that is, there will be summation sign before gx, gy; etc; ∑λgxetc.

Document generated by eLyXer 1.2.5 (2013-03-10) on 2015-05-29T11:22:52.887000

I am an experimental particle physicist, traveler, teacher, researcher, scientist and communicator of ideas. I am a quarkist and a bit quirky ! Hypothesis non fingo, eppur si muove, dubito cogito ergo sum are things that turn me on ! Researcher in experimental high energy physics (aka elementary particle physics; like “quarks, leptons & mesons and baryons”) … Teacher of Physics (and occasionally chemistry and maths) Blogger (check my website; mdashf.org) ! Love to read read and read but only stuff that interest me. Love to puff away my time in frivolities, just dreaming and may be thinking. Right now desperately trying to streamline myself.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s