Lagrange multipliers: Difference between revisions
(Created page with "When a ''(continuous)'' function of one variable is strictly crescent or decrescent we don't have maximum or minimum points unless we set a closed interval, in which case the boundaries themselves are going to be the maximum and minimum points. For functions of two variables we can do the same and set a subdomain to limit our search for maximum and minimum points. The difference is that domain of a two variable function lies in <math>\mathbb{R}^2</math>, which means that...") |
No edit summary |
||
Line 1: | Line 1: | ||
When a ''(continuous)'' function of one variable is strictly crescent or decrescent we don't have maximum or minimum points unless we set a closed interval, in which case the boundaries themselves are going to be the maximum and minimum points. For functions of two variables we can do the same and set a subdomain to limit our search for maximum and minimum points. The difference is that domain of a two | When a ''(continuous)'' function of one variable is strictly crescent or decrescent we don't have maximum or minimum points unless we set a closed interval, in which case the boundaries themselves are going to be the maximum and minimum points. For functions of two variables we can do the same and set a subdomain to limit our search for maximum and minimum points. The difference is that the domain of a function of two variables lies in <math>\mathbb{R}^2</math>, which means that the subdomain is going to be all points from a certain subset, a circumference for example. For functions of three variables we can't see the graph, but we can plot level surfaces and visualise constrains in <math>\mathbb{R}^3</math>. | ||
Many textbooks begin the explanation of Lagrange | Many textbooks begin the explanation of Lagrange multipliers with the partial derivatives and a system of equations. I'm going to use the graphical interpretation first to make it easier to understand the concept: | ||
<div style="text-align:center;"> | <div style="text-align:center;"> | ||
[[image:lagrange_very_simple.png|400px]] | [[image:lagrange_very_simple.png|400px]] | ||
Source: https://en.wikipedia.org/wiki/Lagrange_multiplier | ''''Source:''' https://en.wikipedia.org/wiki/Lagrange_multiplier | ||
</div> | </div> | ||
The function is <math>f(x,y) = x + y</math> and the constrain is <math>x^2 + y^2 = 1</math>. As you can see, the function's domain has been restrained to all points that belong to the equation of a circumference with radius equal to 1. If we displace the circumference along the | The function is <math>f(x,y) = x + y</math> and the constrain is <math>x^2 + y^2 = 1</math>. As you can see, the function's domain has been restrained to all points that belong to the equation of a circumference with radius equal to 1. If we displace the circumference along the vertical axis, <math>f(x,y) = z</math> in this case, we are going to have it intersect the function's surface at some z height. Now the interesting property of the previous point is that, if we consider the constrain to be a function of two variables, we have two parallel gradients there. | ||
How do we know the fact that both gradients are parallel at the previous point? If you think on level curves, every function of two variables can be seen as a set of infinitely many level curves. At every point of a level curve we have a gradient that is perpendicular to that curve. At some z height the circumference is going to touch the graph of <math>f</math> and that point is going to be on some level curve of <math>f</math>. In turn, the equation that gives the constrain can be a level curve of some function <math>g</math> and if it's tangent to a level curve of <math>f</math>, then we have two gradients parallel to each other. | |||
Every exercise is going to require us to solve this system of equations ''(non linear because we often have squares and products of variables)'': | |||
<div style="text-align:center;"> | |||
<math>\begin{cases} | |||
\nabla f(x,y) & = \lambda \nabla g(x,y) \\ | |||
\ \ \ \ g(x,y) & = 0 | |||
\end{cases}</math> | |||
</div> | |||
To explain <math>g(x,y) = 0</math> just think about the constrain. Every function of two variables has its domain on the XY plane, where all points have the form <math>(x,y,0)</math>. The constrain is a subset of the XY plane itself because what the constrain is doing is restricting what points from the function's domain are allowed. | |||
The <math>\lambda</math> is called the '''Lagrange multiplier'''. With <math>f</math> and <math>g</math> being different functions, their respective gradients must have different magnitudes. |
Revision as of 01:12, 1 September 2022
When a (continuous) function of one variable is strictly crescent or decrescent we don't have maximum or minimum points unless we set a closed interval, in which case the boundaries themselves are going to be the maximum and minimum points. For functions of two variables we can do the same and set a subdomain to limit our search for maximum and minimum points. The difference is that the domain of a function of two variables lies in [math]\displaystyle{ \mathbb{R}^2 }[/math], which means that the subdomain is going to be all points from a certain subset, a circumference for example. For functions of three variables we can't see the graph, but we can plot level surfaces and visualise constrains in [math]\displaystyle{ \mathbb{R}^3 }[/math].
Many textbooks begin the explanation of Lagrange multipliers with the partial derivatives and a system of equations. I'm going to use the graphical interpretation first to make it easier to understand the concept:
The function is [math]\displaystyle{ f(x,y) = x + y }[/math] and the constrain is [math]\displaystyle{ x^2 + y^2 = 1 }[/math]. As you can see, the function's domain has been restrained to all points that belong to the equation of a circumference with radius equal to 1. If we displace the circumference along the vertical axis, [math]\displaystyle{ f(x,y) = z }[/math] in this case, we are going to have it intersect the function's surface at some z height. Now the interesting property of the previous point is that, if we consider the constrain to be a function of two variables, we have two parallel gradients there.
How do we know the fact that both gradients are parallel at the previous point? If you think on level curves, every function of two variables can be seen as a set of infinitely many level curves. At every point of a level curve we have a gradient that is perpendicular to that curve. At some z height the circumference is going to touch the graph of [math]\displaystyle{ f }[/math] and that point is going to be on some level curve of [math]\displaystyle{ f }[/math]. In turn, the equation that gives the constrain can be a level curve of some function [math]\displaystyle{ g }[/math] and if it's tangent to a level curve of [math]\displaystyle{ f }[/math], then we have two gradients parallel to each other.
Every exercise is going to require us to solve this system of equations (non linear because we often have squares and products of variables):
[math]\displaystyle{ \begin{cases} \nabla f(x,y) & = \lambda \nabla g(x,y) \\ \ \ \ \ g(x,y) & = 0 \end{cases} }[/math]
To explain [math]\displaystyle{ g(x,y) = 0 }[/math] just think about the constrain. Every function of two variables has its domain on the XY plane, where all points have the form [math]\displaystyle{ (x,y,0) }[/math]. The constrain is a subset of the XY plane itself because what the constrain is doing is restricting what points from the function's domain are allowed.
The [math]\displaystyle{ \lambda }[/math] is called the Lagrange multiplier. With [math]\displaystyle{ f }[/math] and [math]\displaystyle{ g }[/math] being different functions, their respective gradients must have different magnitudes.