diff
Performs numerical differentiation at a point.
Syntax

diff(expr, var, x[, ε])

expr
is a real or complex, scalar. vector, or matrixvalued expression invar

var
, a symbol, is the variable inexpr

x
is the real point at which the derivative is computed 
ε
is the radius aboutx
used for numerical differentiation

Description
diff
computes a symmetric difference quotient of an expression at a specified point:
diff(f(t), t, x, ε) = [f(x + ε) − f(x − ε)] / (2⋅ε).
If omitted, ε
is set to 10^−6.
The expression may be real or complex, scalar, vector, or matrixvalued.
Examples
diff(x^2, x, 1)
2
diff(e^x, x, 1)
2.71828182846
∫(diff(x^2, x, t), t, 0, 2)
4
diff(❨cos(t), sin(t), t❩, t, π/6)
⎛ −0.5 ⎞ e⎜0.866025403784⎟ ⎝ 1 ⎠
diff(❨❨x, i⋅x❩, ❨−i⋅x, x❩❩, x, π)
⎛ 1 1⋅i⎞ ⎝−1⋅i 1⎠
See also

differentiate (synonym)