Using a Lagrange multiplier is a method of finding an extreme value of a function with a constraint; for example, finding the extreme values of which is constrained by . This will occur when the contour lines of the function are parallel, the gradients will therefore be parallel as well (since the gradient vector is always orthogonal to the contour lines). As such, the Lagrange multiplier is a scalar such that
Which results in four unknowns and four equations.
This can be represented more concisely with the Lagrangian function
Suppose we have a small box with a volume of 580 cm3. We want to find the minimum surface area with which we can construct the box.
The function to be extremized is . We will now create a new function, .
There is no one way to solve this system. In this case, are 8.33955, indicating that the minimum surface area which can be used for a given volume is that of a perfect cube. Solutions are often impossible to derive analytically and must be approximated. Note that does not need to be found explicitly.