# Gibbs lemma

Consider $\phi=\sum_{i=1}^n f_i(x_i)$. Suppose $\phi$ is maximized, subject to $\sum x_i=X$ and $x_i\geq 0$, at $x^0=(x_1^0,\ldots,x_n^0)$. If the $f_i$ are differentiable, then the Gibbs Lemma states that there exists a $\lambda$ such that
\begin{align} f'_i(x_i^0)&=\lambda \mbox{ if } x_i^0>0\\ &\leq\lambda\mbox { if }x_i^0=0. \end{align}