The derivative of a function y = f(x) can be written as follows
or f '(x) and is defined as the rate of change of the dependent variable y with respect to x. The derivative is the slope of line tangent to the function at given point.
The MATLAB has a function polyder that will find the derivative of a polynomial. For illustration, for the polynomial x3 + 2x2 - 4x + 3, that would be represented by the vector
[1 2 - 4 3], the derivative is found by:
>> origp = [1 2 -4 3];
>> diffp = polyder(origp)
3 4 -4
that shows that the derivative is the polynomial 3x2 + 4x - 4. The function polyval can be used then to find the derivative for certain values of x; for illustration for x = 1, 2, and 3:
>> polyval(diffp, 1:3)
3 16 35
The derivative can be written as folows
and can be approximated by difference equation.