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 problem we want to optimize has the functions
The latter function is equal to a constant
.
The Lagrange multipliers become the coefficients of the linear combination of gradients. They are often denoted by
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.
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
Putting values into the above equations will give us:
We can now substitute the variables
We can use the rounded value of
Hence, we can now say that
Let's take two more sets as follows:
Hence, you can see that the Lagrange multipliers provide us with the minima
Note: Notice that the sets chosen have to fulfill the constraint defined in
.
To maximize or minimize a multi-variate function:
Introduce a variable
Set the gradient of
Remove the
Free Resources