powered by
Derivative of a function with respect to x
derivative(x, y, m = 0, n = 50)
x coordinates of points in function's domain
y coordinates of points in function's range
the order of the derivative (0 for y, 1 for y', 2 for y'')
number of points in the domain for interpolation
a function representing the mth derivative of y(x) with respect to x
# NOT RUN { x <- seq(0,5,0.1) y <- x^2 - 2*x + 3 # So dy/dx = 2x - 2 fp <- derivative(x, y, 1) fp(2) # 2 fp(5) # 8 # }
Run the code above in your browser using DataLab