# scipy.misc.derivative¶

scipy.misc.derivative(func, x0, dx=1.0, n=1, args=(), order=3)[source]

Find the n-th derivative of a function at a point.

Given a function, use a central difference formula with spacing dx to compute the n-th derivative at x0.

Parameters
funcfunction

Input function.

x0float

The point at which n-th derivative is found.

dxfloat, optional

Spacing.

nint, optional

Order of the derivative. Default is 1.

argstuple, optional

Arguments

orderint, optional

Number of points to use, must be odd.

Notes

Decreasing the step size too small can result in round-off error.

Examples

>>> from scipy.misc import derivative
>>> def f(x):
...     return x**3 + x**2
>>> derivative(f, 1.0, dx=1e-6)
4.9999999999217337


#### Previous topic

scipy.misc.central_diff_weights

scipy.misc.face