Derivative in LaTeX
Updated:
You can write a derivative with a prime, f'(x), or in Leibniz notation as a fraction of differentials. Partial derivatives use the \partial symbol.
Prime notation
f'(x) = 2xA keyboard apostrophe turns into a prime in math mode. The second derivative is two apostrophes, f''(x), not a double quote.
Copying this from handwritten notes? Snap a photo of the page and CamteX turns the formulas into LaTeX. Try it free
Leibniz notation
\frac{dy}{dx}The ISO standard recommends an upright d: \frac{\mathrm{d}y}{\mathrm{d}x}. Many journals use italic d. Pick one and keep it throughout the document.
Second-order derivative
\frac{d^2 x}{dt^2} = -\omega^2 xThe 2 goes on the d in the numerator and on the t in the denominator. This is the harmonic oscillator equation: acceleration is proportional to displacement.
Partial derivative
\frac{\partial f}{\partial x}\partial draws the curly d. Use it when a function depends on several variables and you differentiate with respect to one while holding the others fixed.
Time derivative
\dot{x} = v, \quad \ddot{x} = aA dot over a variable is a time derivative, common in mechanics. \dot gives one dot and \ddot two, which is the second derivative.
Derivative at a point
\left. \frac{df}{dx} \right|_{x=0}A vertical bar with a subscript marks the value of the derivative at a point. \left. opens an invisible delimiter, and \right| draws the bar to the full height of the fraction.
Gradient
\nabla f = \left( \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right)\nabla is the nabla operator. Wrapping the vector of partial derivatives in \left and \right keeps it readable even with tall fractions.
Common mistakes
- Using d instead of \partial for a partial derivative of a multivariable function.
- Typing a period above a variable instead of \dot{x} for a time derivative.
- A double quote instead of two apostrophes for the second derivative: f"(x) does not produce a double prime.
See also
Don't want to memorize commands?
Draw a formula or paste a screenshot, and CamteX turns it into ready LaTeX.