What are Lagrange multipliers?

Lagrange multipliers tend to find the maximum or minimum values of a function. In this Answer, we'll first look at the Lagrange multiplier theorem and then move on to a practical example where such multipliers come in handy.

The Lagrange multiplier theorem

The problem we want to optimize has the functions f(x,y,z)f(x,y,z)and l(x,y,z)l(x,y,z)

The latter function is equal to a constant kk.

The Lagrange multipliers become the coefficients of the linear combination of gradients. They are often denoted by λ\lambda and their values are found by taking into account both functions and applying the constraints given.

A simple syntax for the problem is as follows:

Now, let's move on to an example where we have to solve a problem using Lagrange multipliers.

Example

Let's suppose that we have two equations given as follows:

We are supposed to use the Lagrange multipliers to find either the maximum or minimum values. To do that we will apply λ\lambda to our eq.2eq.2 variables one by one and make them equal to eq.1eq.1:

Putting values into the above equations will give us:

We can now substitute the variables xx, yy, and zz with their respective λ\lambda values in the equation eq.2eq.2:

We can use the rounded value of λ\lambda to find the values of xx, yy and zz as follows:

Hence, we can now say that f(1.5,3,4.5)f(1.5,3,4.5)has the local minimum value. To prove this, we will find the value of ff on these values and then use two more sets of x,y,zx,y,z to compare their values to the minima:

Let's take two more sets as follows:

Hence, you can see that the Lagrange multipliers provide us with the minima58.558.5. There is no other set of x,y,zx,y,z that can give a local minimum lower than this value.

Note: Notice that the sets chosen have to fulfill the constraint defined in eq.2eq.2.

Conclusion

To maximize or minimize a multi-variate function:

  1. Introduce a variable λ\lambda and define function LL as follows:

  1. Set the gradient of LL equal to zero to find the critical points:

  1. Remove the λ\lambda and plug it into the function ff. Whichever gives the greatest or smallest value is the maximum

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved