Recommended resources
The freely available resources this lesson will direct you to.
Hello! Welcome to our next lesson.
In our last session, we formally derived the method of Lagrange multipliers, establishing the profound connection between a constrained optimum, tangent level sets, and parallel gradient vectors. We concluded that solving a constrained optimization problem is equivalent to finding the unconstrained critical points of the Lagrangian function, .
Today, we transition from theory to practice. Our objective is to solve a simple equality-constrained optimization problem using Lagrange multipliers. We will walk through the systematic process of applying the method to concrete examples, translating abstract calculus into tangible solutions. This will solidify the powerful theoretical tools we developed in the last lesson.
The process we will follow is:
- Formulate the problem: Identify the objective function and the constraint .
- Construct the Lagrangian: Define .
- Find the critical points: Solve the system of equations given by .
- Evaluate and interpret: Plug the candidate points back into the objective function to identify the maximum and minimum values.
Part 1: A Complete Walkthrough of a 2D Problem
Let's begin with a classic two-dimensional problem that clearly illustrates every step of the process.
Problem: Find the maximum and minimum values of the function subject to the constraint that the points must lie on the unit circle .
This is a slightly simplified version of the problem in the video we will watch, making the algebra more direct.
Step 1: Formulate the Problem
- Objective function: We want to optimize .
- Constraint function: The points must satisfy .
Step 2: Construct the Lagrangian
Using our standard form, the Lagrangian is:
Note: You may see other sources define the Lagrangian as . This is also correct; it simply inverts the sign of the Lagrange multiplier . Consistency is key.
Step 3: Find the Critical Points by Solving
We need to compute the partial derivatives of with respect to , , and and set them all to zero.
We now have a system of three equations with three unknowns . Solving such systems is often the most challenging part of a Lagrange multiplier problem. A good strategy is to use the first two equations to find a relationship between and .
Substitute the expression for from equation (1) into equation (2):
Rearranging gives:
This equation implies that either or . Let's analyze these two cases.
-
Case A:
If , equation (2) tells us . This means either or .
However, if we plug and into the constraint (equation 3), we get . So, the point is not on the feasible set.
Therefore, we must have , which from eq (1) means . Again, is not a solution. Wait, let's re-trace. If , from the constraint , we must have , so . If and , equation (1) gives , which is impossible.
So, the case (and by symmetry, ) yields no solutions. We can conclude that and . -
Case B:
This implies , so .- If , equation (1) gives .
Plugging this into the constraint (3): .
Since , our candidate points are: and . - If , equation (1) gives .
Plugging this into the constraint (3): .
Since , our candidate points are: and .
- If , equation (1) gives .
We have found four candidate points.
Step 4: Evaluate and Interpret
Finally, we evaluate our objective function at each of these four points.
Comparing these values, we conclude:
- The maximum value is , occurring at and .
- The minimum value is , occurring at and .
The following video solves a very similar problem and provides excellent visual and algebraic intuition for the entire process.
Lagrange Multipliers | Geometric Meaning & Full Example
Dr. Trefor Bazett provides a full step-by-step example of applying the Lagrange Multiplier method. Pay close attention to how he sets up the three equations and systematically solves them to find the candidate points.
Please watch from 07:24 to 11:58. This segment demonstrates the complete algebraic solution for a constrained optimization problem on a circle, similar to the one we just worked through.
Test your understanding!
Let's solve a simple word problem using the same method. You are given 180 yards of fencing to enclose a rectangular area. One side of the area is against a long building, so it does not need a fence. What are the dimensions of the field with the largest possible area?

Use the Lagrange multiplier method to find the optimal dimensions and .
Show answer
-
Formulate:
- Objective:
- Constraint:
-
Lagrangian:
-
Solve :
Now, substitute the expressions for and in terms of into the constraint equation:
-
Find dimensions:
- yards
- yards
The dimensions that maximize the area are 90 yards by 45 yards. The maximum area is square yards.
Part 2: Solving a Problem in 3D
The method extends directly to higher dimensions. Let's tackle a classic problem in three variables, which also has a clear physical interpretation.
Problem: Find the dimensions of a rectangular box with the largest possible volume if its total surface area is fixed at 64 cm².
This is a quintessential application of Lagrange multipliers. I will guide you through the setup, and then you will study the detailed solution from a resource.
Step 1: Formulate the Problem
Let the dimensions of the box be . We can assume .
- Objective function: We want to maximize the volume, .
- Constraint function: The total surface area is given by the sum of the areas of the six faces: . We can simplify this to .
Step 2: Construct the Lagrangian
Step 3: Set up the System of Equations
Taking the partial derivatives and setting them to zero gives:
This system is non-linear and looks more intimidating than our 2D example. However, its symmetry provides a path to a solution. A common technique is to multiply the first equation by , the second by , and the third by , and then see what relationships emerge. The following resource provides a very clear, step-by-step walkthrough of this exact process.
Calculus III - Lagrange Multipliers
The following text from Paul's Online Math Notes provides a detailed solution to the box problem. It demonstrates a standard algebraic technique for solving the resulting system of equations and also discusses how to verify that the solution is indeed a maximum.
Please read 'Example 1' in its entirety. Focus on the algebraic strategy used to solve the system of four equations, which begins by multiplying the first three equations by x, y, and z respectively. Also, note the final step where another point is tested to confirm the solution corresponds to a maximum.
The key result from solving this system is that , meaning the box with the maximum volume for a fixed surface area is a cube.
Part 3: A Second Example Solved
To see another detailed application from start to finish, the MIT video from our last lesson contains an excellent example that is solved on the blackboard. Watching a problem being solved in real-time can be very helpful for understanding the flow of the algebraic steps.
Problem: Find the point on the hyperbola that is closest to the origin.
This is equivalent to minimizing the squared distance subject to the constraint .
Lec 13: Lagrange multipliers | MIT 18.02 Multivariable Calculus, Fall 2007
In this segment, the professor from MIT OpenCourseWare applies the Lagrange multiplier equations derived earlier to solve the example of finding the point on a hyperbola closest to the origin.
Please watch from 14:21 to 25:20. Observe how the system of three equations is set up and solved. The professor uses a method involving the determinant of a matrix, which is a valid but different technique from the direct substitution we used. This highlights that there can be multiple algebraic paths to the same solution.
Conclusion
In this lesson, we have put the theory of Lagrange multipliers into practice. We successfully solved both 2D and 3D optimization problems with equality constraints by following a systematic, four-step process.
Key Takeaways:
- The method of Lagrange multipliers provides a robust algorithm: formulate the problem, construct the Lagrangian, solve , and evaluate the candidate solutions.
- The most difficult step is often solving the resulting system of (usually non-linear) equations. Algebraic techniques and exploiting problem symmetry are crucial skills.
- The method finds candidate points for extrema. To classify them as minima, maxima, or saddle points, you must evaluate the objective function at these points. For problems on a closed, bounded domain, the existence of a max and min is guaranteed by the Extreme Value Theorem.
Preview of the Next Lesson:
Our journey into constrained optimization is not yet complete. Equality constraints are powerful, but many real-world problems involve inequalities (e.g., "budget must be less than or equal to $1000," or "variable must be non-negative"). In our next lesson, we will formulate an optimization problem with inequality constraints, which will set the stage for the more general Karush-Kuhn-Tucker (KKT) conditions.