The derivative of a function f(x) of one variable x is defined as the limit:
lim fHx+hL - fHxL
f'(x) = h Ø 0 .
If y = f(x), the derivative is also denoted as f'(x) = dy/dx. The derivative is the instantaneous rate of change of f(x).
Geometrically, the derivative is the slope of the line tangent to f(x). When the limit exists, the function is said to be
differentiable. It is important to keep in mind that not all functions are differentiable.
There are several ways to evaluate derivatives within Mathematica. We demonstrate them using the cubic polyno-
mial f(x) = 2x + 8x - 3x + 1:
_D := 2 x^3 + 8 x^2 - 3 x + 1;
One way to evaluate the derivative is by using the "prime" notation, f'[x]:
Out=-3 + 16 x + 6 x 2
You can also use the prime notation to evaluate higher derivatives as follows:
Out=16 + 12 x
An alternative way to evaluate derivatives in Mathematica is to use the D command:
Out=-3 + 16 x + 6 x
Note that you have to indicate the variable that you want to take the derivative with respect to (x in this case). This is
because the same command is used to take partial derivatives (see below) of functions of more than one variable.
Higher derivatives are evaluate using the D command as follows (e.g., the second and third derivatives, d yëdx and 2 2
d yëdx ):3
@xD, 8x, 2