Given maximization problem define the Lagrangian,
$$ \mathcal{L}(\mathbf x, \boldsymbol \lambda)=f(\mathbf x)-\sum_{j=1}^{k}\lambda_{j}\cdot(g_{j}(\mathbf x)-c_{j})$$
Notice that the Lagrangian is a function of the choice variables $\mathbf x$ and also of the Lagrangian multipliers $\boldsymbol \lambda$
If $(\mathbf x^\ast, \boldsymbol \lambda^\ast)$ solves the following conditions, it solves the maximization problem.
- $\nabla_{\mathbf x} \mathcal{L}(\mathbf x^\ast, \boldsymbol \lambda^\ast) =0$ where $\nabla_{\mathbf x} \mathcal{L}$ is the gradient of $\mathcal{L}$ with respect the variables $\mathbf x$. Notice that this condition is identical as in the case of the equality constraints.
- For every constraint $j$, $\lambda^{\ast}_{j}\cdot(g_{j}(\mathbf x^{\ast})-c_{j})=0$. Notice that when $\lambda_{j}^{\ast}>0$ this means that $g_{j}(\mathbf x^{\ast})=c_{j}$ and so, the constraint holds as an equality (it is binding).
- For every constraint $j$, $\lambda_{j}^{\ast}\geq 0$. Notice this is different than the recipe for equality constraints since in that case, the Lagrange multipliers could take negative values.
- Every constraint $j$ is respected, $g_{j}(\mathbf x^{\ast})\leq c_{j}$.