📚 Lagrangian Multipliers for Constrained Extrema | 拉格朗日乘子法求约束极值
In single-variable calculus, we find a maximum or minimum by setting the derivative equal to zero. In multivariable calculus, however, we often need to optimize a function subject to a constraint, such as maximizing profit under a fixed budget or minimizing material cost for a fixed volume. The method of Lagrange multipliers introduces an auxiliary variable, λ, and turns the constrained problem into a system of equations that is often much easier to solve than direct substitution.
在单变量微积分中,我们通过令导数等于零来求最大值或最小值。而在多元微积分中,我们经常需要在某个约束条件下优化函数,例如在固定预算下最大化利润,或在固定容积下最小化材料成本。拉格朗日乘子法引入辅助变量 λ,把约束极值问题转化为一个方程组,通常比直接代入消元更容易求解。
1. What Is a Constrained Extremum? | 什么是约束极值?
e area and g(x, y) = 2x + 2y = c is the constraint. This is called an equality constraint.
约束优化问题要求我们在变量并不独立、而是必须满足某个方程 g(x, y) = c 的前提下,求函数 f(x, y) 的极值。例如,若想在周长固定的条件下使矩形面积最大,那么面积函数为 f(x, y) = xy,约束条件为 g(x, y) = 2x + 2y = c。这类问题称为等式约束问题。
2. Geometric Intuition: Tangent Level Curves | 几何直觉:等值线相切
rmal vectors of the two curves are parallel. Since the gradient of a function is normal to its level curves, this means ∇f and ∇g are parallel. Therefore there exists a real number λ such that ∇f = λ∇g. The scalar λ is called the Lagrange multiplier.
在约束 g(x, y) = c 下的内部极值点处,函数 f 的等值线 f(x, y) = k 与约束曲线相切。在切点处,两条曲线的法向量互相平行。由于函数的梯度始终垂直于等值线,这意味着 ∇f 与 ∇g 平行。于是存在实数 λ,使得 ∇f = λ∇g。这个标量 λ 被称为拉格朗日乘子。
ou walk, the value of f usually changes. An extremum occurs exactly when you are at the top or bottom of the "hill" oving neither uphill nor downhill, which means your path is tangent to a level curve of f.
一个有用的直观图像是沿着约束曲线 g = c 行走。行走时,f 的取值通常不断变化。当且仅当你到达“山坡”的最高点或最低点时,才出现极值:此时你既不上坡也不下坡,也就是说你的行走方向正好与 f 的一条等值线相切。
3. The Method of Lagrange Multipliers | 拉格朗日乘子法的步骤
To find the extrema of f(x, y) subject to g(x, y) = c, we define the Lagrangian function:
为了求 f(x, y) 在约束 g(x, y) = c 下的极值,我们定义拉格朗日函数:
L(x, y, λ) = f(x, y) − λ(g(x, y) − c)
Then we solve the system obtained by setting all partial derivatives of L equal to zero:
然后求解由 L 的所有偏导数等于零所组成的方程组:
∂L/∂x = 0, ∂L/∂y = 0, ∂L/∂λ = 0
The first two equations express the tangency condition ∇f = λ∇g.
前两个方程表示相切条件 ∇f = λ∇g。
The third equation simply recovers the constraint g(x, y) = c.
第三个方程实际上还原了约束条件 g(x, y) = c。
After solving, we obtain candidate points. To decide which are maxima and which are minima, substitute each candidate into f and compare the values.
求解后可得到候选点。要判断哪些是最大值、哪些是最小值,只需将各候选点代入 f 比较函数值即可。
4. Example 1: Maximum Area with Fixed Perimeter | 例 1:固定周长下的最大面积
r P. Maximize its area A = xy, where x and y are the side lengths, subject to 2x + 2y = P.
一个矩形的周长为 P,求其面积 A = xy 的最大值,其中 x、y 为边长,约束条件为 2x + 2y = P。
The Lagrangian is:
拉格朗日函数为:
L = xy − λ(2x + 2y − P)
Set the partial derivatives to zero:
令偏导数为零:
∂L/∂x = y − 2λ = 0
∂L/∂y = x − 2λ = 0
∂L/∂λ = −(2x + 2y − P) = 0
6. This confirms the well-known fact that a square maximizes the area for fixed perimeter.
由前两个方程得 y = 2λ,x = 2λ,因此 x = y。约束条件给出 4x = P,所以 x = y = P/4。最大面积为 A = (P/4)² = P²/16。这印证了一个基本事实:在周长固定时,正方形面积最大。
5. Example 2: Extrema of xy on the Unit Circle | 例 2:单位圆上 xy 的极值
Find the maximum and minimum of f(x, y) = xy subject to x² + y² = 1.
求 f(x, y) = xy 在约束 x² + y² = 1 下的最大值与最小值。
Define:
定义:
L = xy − λ(x² + y² − 1)
The resulting equations are:
得到的方程组为:
y − 2λx = 0
x − 2λy = 0
x² + y² = 1
e zero, we find λ = ±1/2. If λ = 1/2, then y = x and x² + y² = 1 yields the two points (1/√2, 1/√2) and (−1/√2, −1/√2); both give f = 1/2. If λ = −1/2, then y = −x, giving (1/√2, −1/√2) and (−1/√2, 1/√2); both give f = −1/2.
将 y = 2λx 代入 x = 2λy,得 x = 4λ²x。由于 x 不可能为零,所以 λ = ±1/2。当 λ = 1/2 时,y = x,结合 x² + y² = 1 得到两点 (1/√2, 1/√2) 与 (−1/√2, −1/√2),此时 f = 1/2。当 λ = −1/2 时,y = −x,得到 (1/√2, −1/√2) 与 (−1/√2, 1/√2),此时 f = −1/2。
= 0, because the point (0, 0), the unconstrained critical point, is not on the constraint.
因此 xy 在单位圆上的最大值为 1/2,最小值为 −1/2。注意,这些极值并不能通过简单地令 ∂f/∂x = ∂f/∂y = 0 得到,因为无约束极值点 (0, 0) 并不在约束曲线上。
6. Example 3: Cobb–Douglas Utility Maximization | 例 3:柯布–道格拉斯效用最大化
budget constraint p x + q y = m, where p and q are prices and m is income. Here a, b > 0.
在经济学中,消费者在预算约束 p x + q y = m 下最大化效用 U(x, y) = xᵃ yᵇ,其中 p、q 为价格,m 为收入,且 a, b > 0。
The Lagrangian is:
拉格朗日函数为:
L = xᵃ yᵇ − λ(p x + q y − m)
The first-order conditions are:
一阶条件为:
a xᵃ⁻¹ yᵇ = λp
b xᵃ yᵇ⁻¹ = λq
p x + q y = m
Dividing the first equation by the second eliminates λ:
将第一个方程除以第二个方程可以消去 λ:
(a y) / (b x) = p / q
Hence y = (b p)/(a q) x. Substituting into the budget gives:
Published by TutorHao | IB Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图