# Gibbs lemma

Consider ${\displaystyle \phi =\sum _{i=1}^{n}f_{i}(x_{i})}$. Suppose ${\displaystyle \phi }$ is maximized, subject to ${\displaystyle \sum x_{i}=X}$ and ${\displaystyle x_{i}\geq 0}$, at ${\displaystyle x^{0}=(x_{1}^{0},\ldots ,x_{n}^{0})}$. If the ${\displaystyle f_{i}}$ are differentiable, then the Gibbs lemma states that there exists a ${\displaystyle \lambda }$ such that
{\displaystyle {\begin{aligned}f'_{i}(x_{i}^{0})&=\lambda {\mbox{ if }}x_{i}^{0}>0\\&\leq \lambda {\mbox{ if }}x_{i}^{0}=0.\end{aligned}}}