# How to solve using lagrange

nikk834

## Homework Statement

if you have dl/dx= -2 +0.002x-lagrange function(backword L)

dl/dy=0.012y-5-lagrange function

dl/dl= -(x+y-2000)
How do you solve for x, y and backword l?

## The Attempt at a Solution

Staff Emeritus
Homework Helper
Is this problem about maximizing or minimizing a function subject to a constraint? If so, what are the function and constraint? I'm asking because I'm not convinced your partial derivatives are correct.

## Homework Statement

if you have dl/dx= -2 +0.002x-lagrange function(backword L)

dl/dy=0.012y-5-lagrange function

dl/dl= -(x+y-2000)
How do you solve for x, y and backword l?

## The Attempt at a Solution

nikk834
Hi Vela , here is the problem that i am asked to solve.

The costs incurred by the company are denoted as follows:
R(x,y) = 7,500 -2x +0.006y^2-5y+0.001x^2

The company has a total of 2,000 knitting hours available each year, representing a constraint as follows:
x+y = 2,000

The company wishes to determine how to allocate the hours of operation between the two sweaters while minimizing cost.
(a)
Using the method of Lagrange, determine how many hours to allocate to each sweater.
(b)
Using the optimal hours determined above, what is the total cost?

Staff Emeritus
Homework Helper
OK, so what I gather you did so far was to construct this function:

$$L(x,y,\lambda) = 7000-2x+0.006y^2-5y+0.001x^2-\lambda(x+y-2000)$$

and took the partial derivatives. (The "backward L" is the Greek letter lambda.)

When you take the partial derivative with respect to x, for example, you have to also differentiate the term representing the constraint, so you'd get

$$\frac{\partial L}{\partial x}=-2+0.002x-\lambda$$

Once you get the derivatives, to find the extrema, you set the partial derivatives to zero and solve the equations.

nikk834
Hi Vela,

I have done that so far and gotten 3 functions:

dl/dx=-2 + 0.002x-Langrange
dl/dy=0.012y-5-lagrange
dl/dl=-(x+y-2000)

I do not know how you would go about solving these equations but i know the solutions are x =1500 y=500 and lagrange=1

How exactly do you solve?

Staff Emeritus
Homework Helper
Like I said, you set them equal to zero so you actually have equations to solve:

$$-2+0.002x-\lambda=0$$

$$-5+0.012y-\lambda=0$$

$$x+y-2000=0$$

nikk834
If i solve it comes out to
0.002x=2L
this comes out as 1000 which is not right
and the next one comes out to 0.012y=5
this comes out to 416 which is not right

Staff Emeritus
Homework Helper
You're not doing the algebra correctly. The first equation should become

$$0.002x = \lambda+2$$

for example. Try solving for lambda in the first equation, and then substitute that into the second equation, so you just have x's and y's. Then solve for either x or y and substitute that into the last equation.

nikk834
ok so lamda=2-0.02x
if i substitude that into the next equation i get 0.012y-5-2-0.02x
how do i solve for that when i got 2 variables x and y.

Staff Emeritus