Equality Constraint in LaTeX (h(x) = 0)
- LaTeX command
h(x) = 0- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Where it is used
Generic equality constraint: the function h must vanish at any feasible point x.
Equality constraints h_j(x) = 0 complement inequality constraints g_i(x) \leq 0 in the standard form of a nonlinear program. In convex optimization they must be affine, so they are often written Ax = b instead. In the Lagrangian each one gets a multiplier \nu_j or \mu_j that, unlike inequality multipliers, may take any sign. The letter h is conventional, but it collides with step size or entropy in some fields; choose letters that do not clash. For several constraints, index them with j to keep them apart from the inequality index i.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Equality Constraint: $h(x) = 0$
\[ h_j(x) = 0, \quad j = 1, \dots, p \]
\end{document}Related symbols
- Lagrangian
\mathcal{L}(x, \lambda) - Constraint
g(x) \leq 0 - Lambda
\lambda - Subject To
\text{s.t.} - Gradient
\nabla f(x) - Maximize
\max_{x}
Frequently asked questions
- How do I write Equality Constraint in LaTeX?
- Type h(x) = 0 in math mode, for example $h_j(x) = 0, \quad j = 1, \dots, p$. It works in plain LaTeX without loading any package.
- Which package do I need for h(x) = 0?
- None. h(x) = 0 is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use h(x) = 0 in text mode, or only in math mode?
- Both. h(x) = 0 compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Editor LaTeX AI Terbaik, Alternatif Overleaf
Octree membantu peneliti dari 15+ universitas menulis makalah penelitian lebih cepat menggunakan AI
- Hasilkan diagram TikZ yang indah menggunakan AI
- Unggah gambar dan konversi ke LaTeX dengan mulus
- Dapatkan bantuan instan untuk menulis dan memformat makalah penelitian