Partial Derivative in LaTeX
The ∂ symbol is \partial. Put it in a fraction for the derivative: \frac{\partial f}{\partial x}. Second derivatives take a power on the top and on the variable: \frac{\partial^2 f}{\partial x^2}; mixed ones list both variables: \frac{\partial^2 f}{\partial x \, \partial y}.
Partial derivative notation
\partialThe ∂ symbol on its own.
\frac{\partial f}{\partial x}First partial derivative.
\frac{\partial^2 f}{\partial x^2}Second partial derivative.
\frac{\partial^2 f}{\partial x \, \partial y}Mixed partial derivative.
\frac{\partial}{\partial x} \left( x^2 y \right)Operator form, applied to an expression.
f_x, \; f_{xy}Subscript notation.
\partial_x fShort operator notation, common in physics.
- Text mode, no math preview
\pdv{f}{x}Shortcut from the
physicspackage (thederivativepackage also defines\pdv); not available in MathJax or KaTeX.
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.
Partial derivative 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.
First partial
LaTeX\frac{\partial f}{\partial x} = 2xyMixed partial
LaTeX\frac{\partial^2 f}{\partial x \, \partial y} = \frac{\partial^2 f}{\partial y \, \partial x}Heat equation
LaTeX\frac{\partial u}{\partial t} = \alpha \frac{\partial^2 u}{\partial x^2}Wave equation
LaTeX\frac{\partial^2 u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2}Evaluated at a point
LaTeX\left. \frac{\partial f}{\partial x} \right|_{(x_0, y_0)}\left.opens an invisible delimiter so\right|can draw a bar of the right height.Held variable (thermodynamics)
LaTeX\left( \frac{\partial U}{\partial S} \right)_{V} = TInline-friendly slash form
LaTeX\partial f / \partial x
Writing higher and mixed partials
The order goes on the ∂ in the numerator and on the variable in the denominator: \frac{\partial^3 f}{\partial x^2 \, \partial y}. A thin space \, between the factors in the denominator keeps them from running together.
In running text a full fraction is tall; \partial f / \partial x or the subscript forms f_x and \partial_x f keep the line height normal.
Shortcut macros
If you write many partials, define a macro in the preamble: \newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}, then type \pd{f}{x}. This works in LaTeX and in MathJax, where macros can be defined in the page configuration.
The physics package provides \pdv{f}{x} and \pdv[2]{f}{x}, and the newer derivative package provides \pdv as well. They are convenient in Overleaf, but web renderers do not support them, so copy-paste into Markdown or a website fails.
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}
% ...
\[ \pd{f}{x} + \pd{f}{y} = 0 \]Common mistakes
A straight d means an ordinary derivative. Use ∂ when f depends on more than one variable.
Instead of\frac{df}{dx} (for a function of several variables)Write\frac{\partial f}{\partial x}In the denominator the power belongs to the variable, because it stands for ∂x·∂x.
Instead of\frac{\partial^2 f}{\partial^2 x}Write\frac{\partial^2 f}{\partial x^2}\deltais the Greek letter δ, which means something else (a variation or a small change).Instead of\delta f / \delta xWrite\partial f / \partial x
In Overleaf, MathJax and Word
Overleaf and pdfLaTeX
\partialand\fracneed no package.\pdvneeds\usepackage{physics}or\usepackage{derivative}; pick one, since both define the same name.MathJax and KaTeX
MathJax and KaTeX render
\partialand\fracfine.\pdvand\dvare not supported by default, so expand them to fractions for web pages, Jupyter and Obsidian.Microsoft Word
Pasted LaTeX is not converted reliably in Word. Write the derivative here and use Copy for Word to paste it as an editable Word equation with a real fraction.
Partial derivative in LaTeX: questions
- What is the LaTeX command for the partial derivative symbol?
\partial, which draws ∂. It is used in math mode, for example$\partial f$.- How do I write a second partial derivative?
\frac{\partial^2 f}{\partial x^2}for the same variable twice,\frac{\partial^2 f}{\partial x \, \partial y}for a mixed partial.- How do I show where a partial derivative is evaluated?
- Use an evaluation bar:
\left. \frac{\partial f}{\partial x} \right|_{x = 0}. - Why does \pdv not work in my Markdown notes?
\pdvcomes from the physics or derivative LaTeX packages. MathJax and KaTeX do not include them by default, so write the fraction out with\partialinstead.
Related LaTeX reference
- Derivative in LaTeXdy/dx with \frac, f'(x) and f''(x), nth derivatives, \dot and \ddot for time derivatives, and what to do about \dv.
- Gradient in LaTeXThe nabla symbol \nabla for gradient, divergence and curl, the Laplacian, the gradient as a vector of partials, and grad as an operator name.
- How to Write a Fraction in LaTeX\frac{numerator}{denominator}, \dfrac and \tfrac for size, continued fractions with \cfrac, slanted fractions and the a/b form.
- 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