拉格朗日乘数

$\int_M \mathrm{d}\omega = \oint_{\partial M} \omega$

$\Lambda(x,y,\lambda) = f(x,y) + \lambda \cdot \Big(g(x,y)-c\Big),$

介绍

$g\left( x,y \right) = c,$

c为常数。對不同$d_n$的值，不难想像出

$f \left( x, y \right)=d_n$

$\nabla \Big[f \left(x, y \right) + \lambda \left(g \left(x, y \right) - c \right) \Big] = 0$

λ ≠ 0.

$F \left( x , y , \lambda \right)$ = $f \left( x , y \right) + \lambda \left( g \left( x , y \right) - c \right)$

拉格朗日乘数的运用方法

f定义为在Rn上的方程，约束为gkx）= ck（或将约束左移得到gk(x) − ck = 0）。定义拉格朗日Λ

$\Lambda(\mathbf x, \boldsymbol \lambda) = f + \sum_k \lambda_k(g_k-c_k)$

$\nabla \Lambda = 0 \Leftrightarrow \nabla f = - \sum_k \lambda_k \nabla\ g_k,$

$\nabla_{\mathbf \lambda} \Lambda = 0 \Leftrightarrow g_k = c_k$

$-\frac{\partial \Lambda}{\partial {c_k}} = \lambda_k$

例子

很简单的例子

$f(x, y) = x^2 y$

$x^2 + y^2 = 1$

$g (x, y) = x^2 +y^2 -1$
$\Phi (x, y, \lambda) = f(x,y) + \lambda g(x, y) = x^2 y + \lambda (x^2 + y^2 - 1)$

$2 x y + 2 \lambda x = 0$
$x^2 + 2 \lambda y = 0$
$x^2 + y^2 -1 = 0$

另一个例子

$f(p_1,p_2,\ldots,p_n) = -\sum_{k=1}^n p_k\log_2 p_k$

$g(p_1,p_2,\ldots,p_n)=\sum_{k=1}^n p_k=1$

$\frac{\partial}{\partial p_k}(f+\lambda (g-1))=0,$

$\frac{\partial}{\partial p_k}\left(-\sum_{k=1}^n p_k \log_2 p_k + \lambda (\sum_{k=1}^n p_k - 1) \right) = 0$

$-\left(\frac{1}{\ln 2}+\log_2 p_k \right) + \lambda = 0$

$p_k = \frac{1}{n}$