# total_diff function

Total derivative of an expression with respect to a variable.

## How to write it

### total_diff(f, x)

**f**

The expression or function to work on. Takes an expression.

**x**

The variable to differentiate by. Takes a variable.

## Examples

- $\displaystyle \frac{d}{dx}(x^{2}) = 2 x$

  `total_diff(x^2, x)`

  In the solver, `total_diff(x^2, x)` gives `2x`.

  [Open in the solver](https://hilberon.com/?q=total_diff%28x%5E2%2C%20x%29)

## Related functions

- [diff](https://hilberon.com/library/diff)

  Derivative of an expression with respect to one or more variables.
- [certified_value](https://hilberon.com/library/certified_value)

  An enclosure of a definite integral or a closed constant, with radius at most 10^-digits.
- [residue](https://hilberon.com/library/residue)

  Residue of an expression at a point.
- [curl](https://hilberon.com/library/curl)

  Curl of a vector field in three variables.
- [numeric_integrate](https://hilberon.com/library/numeric_integrate)

  Approximate a definite integral numerically.
- [derivative](https://hilberon.com/library/derivative)

  The derivative operator: derivative(n) is of order n, derivative(0, 1) is the partial in the second argument.

---
Source: https://hilberon.com/library/total_diff
