Previous Up Next

4.3.2  Approximate computation of the derivative number : nDeriv

nDeriv takes as arguments : an expression ex, the variable name of this expression (by default x), and h (by default h=0.001).
nDeriv(ex,x,h) computes an approximated value of the derivative of the expression ex at the point x and returns :

(f(x+h)-f(x+h))/2*h

Input :

nDeriv(x^ 2,x)

Output :

((x+0.001)^2-(x+-0.001)^2)*500.0

Input :

subst(nDeriv(x^ 2,x),x=1)

Output :

2

Input :

nDeriv(exp(x^ 2),x,0.00001)

Output :

(exp((x+1e-05)^2)-exp((x+-1e-05)^2))*50000

Input :

subst(exp(nDeriv(x^ 2),x,0.00001),x=1)

Output :

5.43656365783

which is an approximate value of 2e=5.43656365692.


Previous Up Next