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”.
Limit Definition of the Derivative
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.
- It may mean that the function has reached a local maximum (or minimum). A local maximum is a value of x where f’(x) changes from positive to negative and thus hits 0 along the way. In f(x), the local maximum is lower than all the points around it.
- It may also mean that the function has reached what is called a local maximum. Our local maximum is higher than the points around it. When f’(x) goes from negative values to 0 to positive values, a local maximum forms.
- It may be an inflection point. This is a point where a function has a change in the direction of curvature. For example, the curve of the function goes from “facing down” to “facing up.” Finding inflection points involves a second derivative test, which we will not get to in this lesson.
If f’(x) > 0, the function is increasing, and if f’(x) < 0, the function is decreasing.
Derivatives in Python
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
from math import pow # dx is the "step" between each x value dx = 0.05 def f(x): # to calculate the y values of the function return pow(x, 3) + 2 # x values f_array_x = [x for x in np.arange(0,4,dx)] # y values f_array_y = [f(x) for x in np.arange(0,4,dx)] # derivative calculation f_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: