Gradient in LaTeX (\nabla f(x))
- LaTeX command
\nabla f(x)- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Gradient of f at x: the vector of first partial derivatives, pointing in the direction of steepest ascent.
The gradient \nabla f(x) = (\partial f/\partial x_1, \dots, \partial f/\partial x_n)^\top drives first-order methods such as gradient descent, x_{k+1} = x_k - \alpha \nabla f(x_k), and its vanishing is the first-order optimality condition for unconstrained problems. \nabla is the inverted triangle, sometimes called del or nabla. The same operator gives divergence, \nabla \cdot \mathbf{F}, and curl, \nabla \times \mathbf{F}, in vector calculus. Do not confuse it with \Delta, the upright triangle used for the Laplacian or finite differences. Add a subscript, \nabla_x f, when differentiating only with respect to some variables.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Gradient: $\nabla f(x)$
\[ x_{k+1} = x_k - \alpha \nabla f(x_k) \]
\end{document}Related symbols
- Hessian
\nabla^2 f(x) - Lambda
\lambda - Optimal Value
x^* - Lagrangian
\mathcal{L}(x, \lambda) - Feasible Set
\mathcal{X} - Equality Constraint
h(x) = 0
Frequently asked questions
- How do I write Gradient in LaTeX?
- Type \nabla f(x) in math mode, for example $x_{k+1} = x_k - \alpha \nabla f(x_k)$. It works in plain LaTeX without loading any package.
- Which package do I need for \nabla f(x)?
- None. \nabla f(x) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \nabla f(x) in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\nabla 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