How to | Take a Derivative
The Wolfram Language makes it easy to take even the most complicated derivatives involving any of its huge range of differentiable special functions.
Define a function with one variable,
:
f[x_] = x ^ 3 - Sin[x ^ 2]To find
, type f'[x] and press
:
f'[x]This method works for any order; just add more primes:
f'''[x]Or use D. Its first argument is the function and its second argument is the variable:
D[f[x], x]For higher-order derivatives using D, the second argument is a list, {variable,order}:
D[f[x], {x, 3}]Define a function with two variables,
:
g[x_, y_] = (x + y) ^ 4Take the first derivative with respect to
and the second with respect to
by combining the two forms (single variable and list):
D[g[x, y], x, {y, 2}]The Heaviside theta function is treated as if it had an infinite pulse at zero, where it is undefined:
{HeavisideTheta[-1], HeavisideTheta[0], HeavisideTheta[1]}The HeavisideTheta function has special derivative properties:
HeavisideTheta'[x]This plots the HeavisideTheta (green) and DiracDelta (red) functions:
Plot[{HeavisideTheta[x], DiracDelta[x]}, {x, -2, 2}, PlotStyle -> {{Thickness[.02], Green}, {Thickness[.01], Red}}]