Gradient in LaTeX
The gradient symbol ∇ is \nabla: write \nabla f for the gradient of f. Divergence and curl use a dot and a cross, \nabla \cdot \mathbf{F} and \nabla \times \mathbf{F}, and the Laplacian is \nabla^2 f or \Delta f.
Vector calculus operators
\nablaNabla (del), the ∇ symbol.
\nabla fGradient of a scalar field.
\nabla \cdot \mathbf{F}Divergence of a vector field.
\nabla \times \mathbf{F}Curl of a vector field.
\nabla^2 fLaplacian.
\Delta fLaplacian written with a capital delta.
\operatorname{grad} fGradient written as an operator name (amsmath).
\nabla_{\mathbf{x}} LGradient with respect to one variable, common in optimization.
Try it live
Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.
Gradient (nabla) examples
Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.
Gradient as a vector
LaTeX\nabla f = \left( \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z} \right)Gradient as a column
LaTeX\nabla f(\mathbf{x}) = \begin{bmatrix} \dfrac{\partial f}{\partial x_1} \\ \vdots \\ \dfrac{\partial f}{\partial x_n} \end{bmatrix}\dfrackeeps the fractions full size inside the matrix.Divergence
LaTeX\nabla \cdot \mathbf{F} = \frac{\partial F_x}{\partial x} + \frac{\partial F_y}{\partial y} + \frac{\partial F_z}{\partial z}Curl
LaTeX\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}Laplacian
LaTeX\nabla^2 u = \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}Gradient descent step
LaTeX\mathbf{w}_{t+1} = \mathbf{w}_t - \eta \, \nabla_{\mathbf{w}} L(\mathbf{w}_t)Directional derivative
LaTeXD_{\mathbf{u}} f = \nabla f \cdot \hat{\mathbf{u}}
Gradient, divergence and curl
\nabla is a normal math symbol, so it combines with the operators you already know: nothing for the gradient (\nabla f), \cdot for divergence and \times for curl. Write vector fields in bold (\mathbf{F}) or with an arrow to tell them apart from scalars.
Some texts, especially in physics, write the gradient as a bold nabla. \boldsymbol{\nabla} works in LaTeX (amsmath) and in MathJax.
grad, div and curl as words
European textbooks often use the names instead of the symbol. Write them with \operatorname so they come out upright and spaced like \sin, or declare them once in the preamble.
\usepackage{amsmath}
\DeclareMathOperator{\grad}{grad}
\DeclareMathOperator{\divg}{div}
\DeclareMathOperator{\curl}{curl}
% ...
\[ \grad f, \quad \divg \mathbf{F}, \quad \curl \mathbf{F} \]Common mistakes
Δ is the Laplacian or a difference; the gradient uses the upside-down triangle ∇.
Instead of\Delta f (meaning the gradient)Write\nabla fTyped letters are set as italic variables g·r·a·d.
Instead ofgrad fWrite\operatorname{grad} f\divalready exists (the ÷ sign), so\newcommandstops with an error; pick another name.Instead of\newcommand{\div}{…}Write\DeclareMathOperator{\divg}{div}
In Overleaf, MathJax and Word
Overleaf and pdfLaTeX
\nabla,\cdot,\timesand\Deltaneed no packages.\operatorname,\DeclareMathOperator,\boldsymboland\dfracneed amsmath.MathJax and KaTeX
MathJax and KaTeX render
\nabla,\operatorname{grad}and\boldsymbol{\nabla}directly.\DeclareMathOperatorbelongs in a LaTeX preamble; on the web define macros in the renderer configuration or use\operatorname.Microsoft Word
Word’s equation editor has a nabla symbol, but pasted LaTeX is not converted reliably. Write the expression here and use Copy for Word to paste an editable equation.
Gradient (nabla) in LaTeX: questions
- What is the LaTeX command for the gradient symbol?
\nabla, which draws ∇. The gradient of f is\nabla f.- How do I write the upside-down triangle in LaTeX?
- That symbol is nabla:
\nabla. The upright triangle Δ is\Delta. - How do I write divergence and curl?
- Divergence is
\nabla \cdot \mathbf{F}and curl is\nabla \times \mathbf{F}. - How do I write the Laplacian?
- Either
\nabla^2 for\Delta f; both are in common use.
Related LaTeX reference
- Partial Derivative in LaTeXThe ∂ symbol (\partial) inside \frac for first, second and mixed partials, subscript notation, evaluation bars and shortcut macros.
- Vector in LaTeX\vec{v} and \overrightarrow{AB}, bold vectors with \mathbf and \boldsymbol, unit vectors, column and row vectors, and norms.
- Cross Product in LaTeX\times between vectors, the i, j, k determinant with vmatrix, dotless-i unit vectors and the magnitude formula.
- LaTeX equation editorSymbol panel, live preview, and PNG, SVG, MathML or Word export.
- All LaTeX reference pagesSymbols, math structures and text formatting in one list.
Have the formula as a picture?
Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.
Convert an image to LaTeX