Finding extreme values like minimum distance and maximum area with calculus is fun. This lesson explores the Lagrange multiplier method which extends the calculus approach even further.
Lagrange Multiplier Method
Your friend grows and sells blue hibiscus plants. He knows the cost relationship of two plant cultivation methods. How many plants should he grow using each method to meet an order request and minimize cost?
This question is similar to minimum and maximum problems in calculus, but we have more information that can be expressed as equations. The Lagrange multiplier method uses these equations and a proportionality constant to solve these types of minimum and maximum problems.
Returning to the hibiscus, let's see how we use the Lagrange multiplier method to minimize cost. Let's say the ordered amount is 300 plants. We grow x plants using one method and y plants with the other. The constraint equation is g = x + y = 300. An equation with two equal signs is a convenient way to write three forms of the same equation. We can have g = x + y, g = 300 and x + y = 300.
The suggested cost relationship is C = x^2 + 2y^2. This is called the objective equation. A good name: the objective is to find the x and y which minimize C. There are many factors impacting the objective equation. All of the factors like price of seeds, delivery charges, amount of fertilizer, … are lumped into the C = x^2 + 2y^2 equation.
So far, we have two equations: a constraint equation g and an objective equation C:
We take partial derivatives with respect to x and y of each equation. The partial derivative is the usual derivative but one letter is the variable while everything else is constant. The partial derivative of g with respect to x, written as gx, is the derivative of x + y with x treated as the variable: y as a constant. Thus, gx = 1 + 0 = 1. Likewise, we calculate gy, Cx and Cy.
Let's write the four partial derivatives: gx = 1, gy = 1, Cx = 2x and Cy = 4y. Do you see how Cy = 4y? We differentiate x^2 + 2y^2 with y as a variable and x as a constant. The derivative of the constant x^2 is zero. The derivative of 2y^2 is 2(2)y = 4y.
So far, we have two equations, g and C, and the partial derivatives of g and C with respect to x and y. The partial derivatives are gradients which describe how a quantity changes with x or with y. To equate the gradients of g and C, we write:
The variable λ in the equations is the 'multiplier' in the 'Lagrange multiplier method'. It is a proportionality constant used to equate the gradients. Substituting for the partial derivatives in the Cx = λ gx equation we get 2x = λ which means x = λ/2.
Substituting for the partial derivatives in the Cy = λ gy equation we get 4y = λ which means y = λ/4. From the constraint equation x + y = 300 we have λ/2 + λ/4 = 300. Solving we get λ = 400.
Thus, x = λ/2 = 400/2 = 200 and y = λ/4 = 400/4 = 100. To minimize the objective function, your friend grows 200 hibiscus with the first method and 100 with the other.
If we plot the objective function in this example, we get a curved surface. In the plot you see x and y axes. We see the objective function on the z axis. This curved surface has a minimum at x = 0, y = 0. However, we want the x and y for a minimum constrained by x + y = 300. The red line is the constraint equation lying on the surface of the objective function. The blue dot is the minimum for this line. It is located at x = 200 and y = 100.
The Lagrange multiplier method will find an extreme value if it exists. This extreme value could be a maximum or a minimum. Usually we check by substitution or a plot.
Your friend is happy but has another question.
Over 79,000 lessons in all major subjects
Get access risk-free for 30 days,
just create an account.
Your friend's garden space is elliptical: it's described by the constraint equation g = 4x^2 + y^2 = 80. He would like to construct a rectangular plant box within this space using as much surplus material as possible. Our goal is to design the largest perimeter rectangular box fitting inside the ellipse. His possible solution is to fit a square with sides of length 8 giving a perimeter of 32:
A possible solution.
Can we do better by applying the Lagrange multiplier method?
The objective function C is the perimeter, which we want to maximize. Locate a corner of the box in the first quadrant. This is our x and y. The length of the box is 2x and the width is 2y. The perimeter is 2(2x + 2y) which equals 4(x + y).
Calculating partial derivatives: gx = 8x, gy = 2y, Cx = 4 and Cy = 4. Substituting for the partial derivatives in the Cx = λ gx equation we get 4 = λ8x which means x = 1/(2λ). Substituting for the partial derivatives in the Cy = λ gy equation we get 4= λ2y which means y = 2/λ.
From the constraint equation 4x^2 + y^2 = 80 we have 4/(2λ)^2 + 4/λ^2 = 80. Solving we get λ = 1/4. We take the positive square root since the x and y variables defined in the first quadrant are strictly positive.
This gives us x = 1/(2λ) = 4/2 =2 and y = 2/λ = 2(4) = 8. The perimeter for these values is 4(2+8) = 40. A plot of perimeter vs x or substituting values for x verifies we have found a maximum.
The best solution.
Our friend is happy with all the math calculations. Now might be a good time to ask for a maximum discount price on the plants.
The Lagrange multiplier method uses a constraint equation and an objective equation to find solutions to minimum and maximum problems. The method equates the gradients of each equation using a proportionality constant called the Lagrange multiplier. If a solution exists, simultaneously solving these gradient equations with the constraint equation provides a solution. The solution is tested to see if a minimum or a maximum has been found.
Did you know… We have over 200 college
courses that prepare you to earn
credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the
first two years of college and save thousands off your degree. Anyone can earn
credit-by-exam regardless of age or education level.