Limits quantify what happens to the values of a function as we approach a given point. This can be defined notationally as:
We can read this in simple terms as “the limit as x goes to 6 of f(x) approaches some value L”.
The limit definition of the derivative proves how to measure the instantaneous rate of change of a function at a specific point by looking at an infinitesimally small range of x values.
The animation provided shows that as we look at a smaller range of x values, we approach the instantaneous range of a point.
The derivative is the slope of a tangent line at a specific point, and the derivative of a function f(x) is denoted as f’(x). We can use the derivative of a function to determine where the function is increasing, decreasing, at a minimum or maximum value, or at an inflection point.
If f’(x) = 0, then the function is not changing. This can mean one of a few things.
If f’(x) > 0, the function is increasing, and if f’(x) < 0, the function is decreasing.
We can use the np.gradient()
function from the NumPy library to calculate derivatives of functions represented by arrays. The code block shown shows how to calculate the derivative of the function f(x) = x3 + 2 using the gradient()
function.
from math import pow# dx is the "step" between each x valuedx = 0.05def f(x):# to calculate the y values of the functionreturn pow(x, 3) + 2# x valuesf_array_x = [x for x in np.arange(0,4,dx)]# y valuesf_array_y = [f(x) for x in np.arange(0,4,dx)]# derivative calculationf_array_deriv = np.gradient(f_array_y, dx)
To take the derivative of polynomial functions, we use the power rule. This states the following:
There are rules even beyond the power rule. Many common functions have defined derivatives. Here are some common ones:
There are general rules we can use to calculate derivatives.
The derivative of a constant is equal to zero:
Derivatives are linear operators, meaning that we can pull constants out of derivative calculations:
The derivative of a sum is the sum of the derivatives, meaning we can say the following:
We define the derivative of two products as the following: