# Lagrange Multipliers

One of the major problems that engineers face is the problem of optimization of a certain function. Mathematics provides us with a beautiful way to solve such problems. This method is known as the Method of **Lagrange Multipliers**.

So how and when to apply? There are certain conditions.Suppose you have the following problem:

Find the coordinates of the point on the plane 2x + 3y – 5z = 1 which is at the least distance from the origin.

So the function you want to optimize is,

√(x^{2}+ y^{2}+ z^{2}), Let this be f(x, y, z)

But we have a constraint;the point should lie on the given plane.Hence this ‘constraint function’ is generally denoted by g(x, y, z).But before applying Lagrange Multiplier method we should make sure that g(x, y, z) = c where ‘c’ is a constant. In this situation,

g(x, y, z) = 2x + 3y - 5z

It is indeed equal to a constant that is ‘1’. Hence we can apply the method.

Now the procedure is to solve this equation:

∇f(x, y, z) = λ∇g(x, y, z)

where λ is a real number.

This gives us 3 equations and the fourth equation is of course our constraint function g(x, y, z).Solve for x, y, z and λ.

An example will make it clear.

**Example:**

Find the maximum and minimum values of **f(x, y, z) = 3x ^{2} + y ** subject to the constraint,

4x - 3y = 9 and x^{2}+ z^{2}= 9

.

This example has been deliberately taken to teach you what to do in case of more than one constraint functions. In such cases assume as many arbitrary constants as the number of constraint functions and write the equation in the form:

∇f(x, y, z) = c_{1}∇g(x, y, z) + c_{2}∇h(x, y, z) + c_{3}∇p(x, y, z) ... ...

where c_{i} for i=1, 2, 3… are just real numbers and g, h, p are constraint functions.

Now if you get more than one triplet, figure out which one represents a maximum and which one represents the minimum by satisfying it in the function to be optimized and compare the values.In this question the answer would be:

Maximum for (-2/√13, 3/√13, -2 - 7/√13) and Minimum for (2/√13, -3/√13, -2 + 7/√13)

## Recommended Posts:

- Mathematics | Lagrange's Mean Value Theorem
- Check if a number is Prime, Semi-Prime or Composite for very large numbers
- Python - Legendre polynomials using Recursion relation
- Lehmann's Primality Test
- Hyperbolic Functions
- Second Order Linear Differential Equations
- Gauss's Forward Interpolation
- Finite Group in Algebraic Structure
- Counting Boolean function with some variables
- Program for Picard's iterative method | Computational Mathematics
- Count of numbers whose 0th and Nth bits are set
- Program for Gauss Siedel Method (Computational Mathematics)
- Properties of Determinants of Matrices
- Rough Set Theory | Properties and Important Terms | Set - 2

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.