D
[f, x]D
[f, x, y, ...]D
[f, {x, n}]D
[f, {{$x_1$, $x_2$, ...}}]First-order derivative of a polynomial:
D[x^3 + x^2, x]
Second-order derivative:
D[x^3 + x^2, {x, 2}]
Trigonometric derivatives:
D[Sin[Cos[x]], x]
D[Sin[x], {x, 2}]
D[Cos[t], {t, 2}]
Unknown variables are treated as constant:
D[y, x]
D[x, x]
D[x + y, x]
Derivatives of unknown functions are represented using Derivative
:
D[f[x], x]
D[f[x, x], x]
D[f[x, x], x] // InputForm
Chain rule:
D[f[2x+1, 2y, x+y], x]
D[f[x^2, x, 2y], {x,2}, y] // Expand
Compute the gradient vector of a function:
D[x ^ 3 * Cos[y], {{x, y}}]
Hesse matrix:
D[Sin[x] * Cos[y], {{x,y}, 2}]