Lagrange multipliers

Database › Mathematics › Applied mathematics › Optimization

OPTM-0001MethodUndergraduate

At a constrained extremum the gradient of the function is a linear combination of the gradients of the constraints; the coefficients are the Lagrange multipliers.

$$\nabla f=\lambda\nabla g\ \ (g=0),\qquad L(\mathbf x,\lambda_1,\dots)=f-\sum_j\lambda_jg_j,\ \ \nabla_{\mathbf x}L=0$$

Explanation

On the constraint surface $g=0$, $f$ is stationary when its gradient has no component along the surface, i.e. is parallel to $\nabla g$. With $m$ constraints there are $m$ multipliers; together with the constraints, $\nabla_{\mathbf x}L=0$ gives as many equations as unknowns. The multiplier measures the sensitivity of the optimum to the constraint: $d f^*/dc=\lambda$ for $g=c$.

In physics the multipliers often become physical quantities: maximising entropy at fixed energy and particle number introduces $\beta=1/k_BT$ and the chemical potential. Whether a stationary point is a maximum or minimum needs a separate check (e.g. the bordered Hessian, or comparison of values).

Example 1

Find the maximum of $xy$ on the ellipse $x^2+4y^2=8$.

Solution

$y=2\lambda x$, $x=8\lambda y$ give $16\lambda^2=1$, $\lambda=\frac14$ and $x=2y$. Then $8y^2=8$: $(x,y)=(2,1)$ or $(-2,-1)$, and the maximum is $xy=2$.

Example 2

Maximise $S=-\sum_{i=1}^Np_i\ln p_i$ subject to $\sum p_i=1$ and $\sum p_iE_i=U$.

Solution

$\partial_{p_i}\big[S-\alpha\sum p_i-\beta\sum p_iE_i\big]=-\ln p_i-1-\alpha-\beta E_i=0$, so $p_i=e^{-\beta E_i}/Z$ with $Z=\sum e^{-\beta E_i}$: the Boltzmann distribution, with $\beta$ fixed by $U$. Without the energy constraint the result is uniform, $p_i=1/N$.

Related entries