Hessian in LaTeX (\nabla^2 f(x))
- LaTeX command
\nabla^2 f(x)- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Hessian of f at x: the matrix of second partial derivatives, describing local curvature.
In optimization, \nabla^2 f(x) is the Hessian, used in Newton's method, x_{k+1} = x_k - [\nabla^2 f(x_k)]^{-1} \nabla f(x_k), and in second-order conditions: a positive definite Hessian at a stationary point means a strict local minimum. Be careful: in physics and PDEs, \nabla^2 f means the Laplacian, a scalar equal to the trace of the Hessian, often written \Delta f. Clarify which you mean, or use H_f or \nabla\nabla^\top f for the matrix. Convexity of a twice-differentiable function is equivalent to \nabla^2 f(x) \succeq 0 everywhere.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Hessian: $\nabla^2 f(x)$
\[ \nabla^2 f(x) \succeq 0 \quad \forall x \in \operatorname{dom} f \]
\end{document}Related symbols
- Optimal Value
x^* - Gradient
\nabla f(x) - Feasible Set
\mathcal{X} - Lambda
\lambda - Function
f(x) - Lagrangian
\mathcal{L}(x, \lambda)
Frequently asked questions
- How do I write Hessian in LaTeX?
- Type \nabla^2 f(x) in math mode, for example $\nabla^2 f(x) \succeq 0 \quad \forall x \in \operatorname{dom} f$. It works in plain LaTeX without loading any package.
- Which package do I need for \nabla^2 f(x)?
- None. \nabla^2 f(x) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \nabla^2 f(x) in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\nabla^2 f(x)$ in running text.
Editor LaTeX AI Terbaik, Alternatif Overleaf
Octree membantu penyelidik dari 15+ universiti menulis kertas penyelidikan dengan lebih cepat menggunakan AI
- Jana diagram TikZ yang cantik menggunakan AI
- Muat naik imej dan tukar ke LaTeX dengan lancar
- Dapatkan bantuan segera untuk menulis dan memformat kertas penyelidikan