KKT Conditions in LaTeX (\nabla f + \lambda \nabla g = 0)
- LaTeX command
\nabla f + \lambda \nabla g = 0- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Stationarity condition of the KKT system: the objective gradient is balanced by the weighted constraint gradients.
This line is the first of the Karush-Kuhn-Tucker conditions; the full set adds primal feasibility g(x) \leq 0, dual feasibility \lambda \geq 0, and complementary slackness \lambda g(x) = 0. With several constraints it generalizes to \nabla f(x^*) + \sum_i \lambda_i \nabla g_i(x^*) + \sum_j \nu_j \nabla h_j(x^*) = 0. Typeset the whole system in a cases or aligned environment for readability. Sign conventions differ: if the Lagrangian is written f - \lambda g, the plus becomes a minus, so match it to your definition. Evaluating at x^* explicitly avoids ambiguity.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
KKT Conditions: $\nabla f + \lambda \nabla g = 0$
\[ \nabla f + \lambda \nabla g = 0, \quad \lambda \geq 0, \quad \lambda g(x) = 0 \]
\end{document}Related symbols
- Calligraphic C (category)
\mathcal{C} - Mu
\mu - Positive Definite
\succ 0 - Function
f(x) - Positive Semidefinite
\succeq 0 - Feasible Set
\mathcal{X}
Frequently asked questions
- How do I write KKT Conditions in LaTeX?
- Type \nabla f + \lambda \nabla g = 0 in math mode, for example $\nabla f + \lambda \nabla g = 0, \quad \lambda \geq 0, \quad \lambda g(x) = 0$. It works in plain LaTeX without loading any package.
- Which package do I need for \nabla f + \lambda \nabla g = 0?
- None. \nabla f + \lambda \nabla g = 0 is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \nabla f + \lambda \nabla g = 0 in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\nabla f + \lambda \nabla g = 0$ in running text.
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기