13.23
A rectangular pen is to be built against a barn wall using 100 meters of fencing. Because the wall forms one side, only three sides need fencing. The goal is to find the dimensions that give the largest area.
This is a constrained optimization problem because the area must be maximized while the fencing length remains fixed.
Lagrange multipliers give a clear way to include this restriction. In the length-width plane, the fencing condition forms a constraint curve that limits the possible pen dimensions. The maximum happens where a level curve of the area touches the constraint curve. At that point, both curves share a common tangent, so their gradients are parallel.
The gradients may have different sizes, so one is multiplied by a constant to match the other. This constant is the Lagrange multiplier, lambda.
The next step is to take partial derivatives with respect to length and width. Solving these equations shows that the length is twice the width. Substituting this relationship into the fencing constraint gives the two dimensions. These dimensions give the largest possible area for the rectangular pen. This shows how Lagrange multipliers connect optimization, geometry, and constraints.
In constrained optimization, the objective is to maximize or minimize a quantity while satisfying a fixed condition. A standard example is a rectangul…
Copyright © 2026 MyJoVE Corporation. All rights reserved.