Hessian in LaTeX (\nabla^2 f(x))

∇2f(x)\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.

∇2f(x)⪰0∀x∈dom⁡f\nabla^2 f(x) \succeq 0 \quad \forall x \in \operatorname{dom} f
\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

All التحسين →

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.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث