How do you write derivatives in LaTeX?

First of all, you will try to represent the derivative in the document by passing multiple expressions in the fraction.

  \[ {dx},\mathrm{d}y, \mathrm{d}z \]
  \[ \frac{dx}{dt}, \frac{\mathrm{df}}{dy}, \frac{\mathrm{d}}{\mathrm{d}z}f(z) \]
  \[ \frac{\mathrm{d}}{\mathrm{d}t}, \frac{\mathrm{d^2}}{\mathrm{d}t^2}, \frac{\mathrm{d^3}}{\mathrm{d}t^3} \]

Output :

Derivative using default latex command. 

But, why would you use such a big syntax again and again! And for some more limitations, derivatives and physics packages have been created in Latex.

Use physics and derivative for LaTeX

\dv command is included in the physics package for ordinary derivatives. And in this case, syntax are

  % Use physics package for Differentials
  \[ \dd, \dd x, \dd{x}, \dd[3]{x}, \dd(\sin\theta) \]
  \[ \dv{y}, \dv{f}{y}, \dv[3]{f}{y} \]
  \[ \dv{x}(\frac{1}{x^c}) \]    
  % Inline form for text mode
  \[ \dv*{f}{y} \]

Output :

Derivative using physics package.

However, in a derivative package, both command and syntax are different from physics. Order value must be given as an optional argument for the order.

   % Use derivative package for Differentials
   \[ \odif{x}, \odif{y}, \odif{z} \]
   \[ \odif{x,y,z} \]
   \[ \odif*{x,y,z} \]
   \[ \odif[order={1,2,3}]{x,y,z} \] 
   \[ \odv{y}{x}, \odv[order={2}]{x}{t}, \odv[order={n}]{y}{z} $

Output :

Using deivative package.

Use partial derivatives

Manually, there are \partial commands for partial derivatives. But, I will use physics package where there is \pdv command.

   \[ \pdv{x},\pdv{f}{x}, \pdv{f}{x}{y} \]
   \[ \pdv{x}(\frac{5}{2})   \]
   % inline form for partialderivative
   \[ \pdv*{f}{x}  \]

Output :

Partial derivatives latex output.

This package has the same command. However, there are many features that are not included in the physics package. For this reason, in the case of partial derivatives, the best practice is to use the derivative package.

   \[ \pdv[order={i,j,k}]{f}{x,y,z} \]
   \[ \pdv[order={2,3,4}]{f}{x,y,z} \]
   \[ \pdv*{f}{x,y} \]
   \[ \pdv{f(x,y,z)}{x}(17,u+v,v^2) \]
   \[ \pdv{f}{x}_{y,z},\; \pdv{f}{x,y}^{(x_2,y_2)}_{(x_1,y_1)} \]
   \[ \nabla f(a)=\left(\pdv{f}{x_1}(a),\cdots,\pdv{f}{x_n}(a) \right) \]
   \[ \nabla = \sum_{j=1}^n\left[\pdv{}{x_j} \right]\hat{e}_j \]

Output :

Partial derivatives using derivative package for output.

Dot derivative in LaTeX

There is no special package or command for dot or time derivative, manually represented below.

   % \dot and \ddot is a default command in latex   
   \[ \dv{v}{t} = \dot{v} \]
   \[ \dv[2]{v}{t} = \ddot{v} \]
   % \dddot is a physics package's command
   \[ \dv[3]{v}{t} = \dddot{v} \]

Output :

Dot derivative output.

Use evaluated bar

Evaluated bar is used when the value of the variable is given along with the derivative. If you pass the expression in a short command \eval, the whole expression will be completed.

   \[ \eval{\pdv{f}{x}}_{x=0} \]
   \[ \eval{\pdv[2]{f}{x}}_{x=0} \]
   \[ \eval{\pdv[3]{f}{x}}_{x=0} \]
   \[ \eval{\pdv[n]{f}{x}}_{x=0} \]

Output :

Evaluated bar with derivative.

Md Jidan Mondal

LaTeX expert with over 10 years of experience in document preparation and typesetting. Specializes in creating professional documents, reports, and presentations using LaTeX.

Leave a Comment

Your email address will not be published. Required fields are marked *