Gradient in LaTeX (\nabla f(x))

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

xk+1=xk−α∇f(xk)x_{k+1} = x_k - \alpha \nabla f(x_k)
\documentclass{article}
\begin{document}
Gradient: $\nabla f(x)$

\[ x_{k+1} = x_k - \alpha \nabla f(x_k) \]
\end{document}

Related symbols

All التحسين →

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

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

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

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