= Lagrange multiplier
{c}
{title2=$\lambda$}
{wiki}
For <continuously differentiable functions> $f,g$ on an <open subset> of $\mathbb R^n$, suppose $z_*$ is a local <extremum> of $f$ subject to $g(z)=b$, with $\nabla g(z_*)\ne0$. Then a <real number> $\lambda$, the <Lagrange multiplier>, satisfies
$$
\nabla f(z_*)=\lambda\nabla g(z_*).
$$
The nonzero <gradient> assumption excludes singular points of the <optimization constraint>. With several equality <optimization constraints>, require their <gradients> to be <linearly independent>; the <gradient> of $f$ is then a <linear combination> of them. These are necessary conditions, not automatic certificates of a <global maximum> or <global minimum>.
Why can the <gradient> be nonzero at an optimum? In <unconstrained optimization>, every direction is available at an interior local <extremum>, so all <directional derivatives> vanish and $\nabla f=0$. On a regular equality <feasible set>, only directions in its <tangent space> are available to first order. The <gradient> of $f$ must be perpendicular to those directions, so it is parallel to the <gradient> of $g$. In two dimensions this explains the tangency of their <level sets>. See https://ocw.mit.edu/ans7870/18/18.02/f07/tools/LagrangeMultipliersTwoVariables.html[MIT, Lagrange multipliers and contour geometry].
For the product example, set $g(x,y)=x+y$ and use the <optimization Lagrangian>
$$
L(x,y,\lambda)=xy-\lambda(x+y-10).
$$
Its <partial derivatives> give $y-\lambda=0$, $x-\lambda=0$, and $x+y=10$. Hence $x=y=\lambda=5$. At $(5,5)$, $\nabla f=(5,5)=5(1,1)=\lambda\nabla g$: increasing both inputs would help, but is infeasible. Along the allowed direction $(1,-1)$, the <directional derivative> is zero. The endpoints must still be checked because of the nonnegativity <optimization constraints>; <completing the square> establishes the unique <global maximum>.
The sign convention matters: writing $L=xy+\mu(x+y-10)$ instead gives $\mu=-5$. Neither equality <Lagrange multiplier> has a universal nonnegativity requirement. Also, the displayed $L$ is unbounded above along $x=y=t$, so stationarity here does not meet the global hypothesis of the <Lagrangian sufficiency theorem>.
The <Lagrange multiplier> also measures the value of extra resources. For a positive budget $b$, the optimizer is $(b/2,b/2)$, the optimum value is $V(b)=b^2/4$, and $V'(b)=b/2=\lambda$. At $b=10$, an extra $0.1$ units predicts a gain of $0.5$; the exact gain is $V(10.1)-V(10)=0.5025$. This is the <envelope theorem> in a computed <sensitivity analysis>: the multiplier translates a binding <budget constraint> into a marginal benefit.
Back to article page