# Lagrange Multipliers question

• Feb 13th 2009, 12:52 PM
Kim Nu
Lagrange Multipliers question
Find the maximum of the function f(x,y)= -(x-a)^2 - (y-b)^2 subject to the constraint y=kx.

So here's where I'm at:

1. δf/δx = -2(x*-a) ; δf/δy = -2(y*-b) (* means for a particular x or y)

2. g(x,y) = y-kx = 0

3. δg/δx = -λ ; δg/δy = λ

And then from here, I'm not really sure where to go. Any suggestions? Thanks,

Kim
• Feb 13th 2009, 04:36 PM
Rincewind
The way to do this is to define a new function

$f(x,y)=-(x-a)^2 -(y-b)^2$

$g(x,y) = y - kx = 0$

So you form a new function

$L(x,y;\lambda) = f(x,y) - \lambda g(x,y)$

$L(x,y;\lambda) = -(x-a)^2 -(y-b)^2 - \lambda(y-kx)$

Now find the partial derivatives w.r.t x and y and set them to zero

$\frac{\partial L}{\partial x}= -2(x-a) + \lambda k = 0$

$\frac{\partial L}{\partial y}= -2(y-b) - \lambda = 0$

Now you want to eliminate lambda. So you multiply the second equation by k as add them to give

$-2(x-a) -2k(y-b) = 0$

And finally you substitute from your constraint y = kx to give

$-2(x-a) -2k(kx -b) = 0$

which simplifies to

$x = \frac{kb+a}{k^2+1}$

Lastly you need to find the y which can be found by substituting in the constraint (y = kx) therefore

$y = k\left(\frac{kb+a}{k^2+1}\right).$

Hope this helps. Lagrangian multipliers are very useful devices and come up in lots of interesting places.