Derivatives of Basic Functions
Objectives
- Use the 1st and 2nd derivatives to characterize a function (increasing/decreasing, local extrema, concavity, inflection points).
- Find derivatives of basic power functions using the power rule, by hand.
- Find derivatives of basic modeling functions by hand (exponential, sinusoidal, logarithmic, etc.).
- Compute derivatives of linear combinations using the constant, constant-multiple, and sum/difference rules.
- In R, use D() to find the derivative of a function.
1. Characterizing a Function
Objective. Use the 1st and 2nd derivatives to characterize a function (increasing/decreasing, local extrema, concavity, inflection points).
Intervals of increase and decrease, local extrema, concavity, and points of inflection are read from the graphs of and in sections 3 and 4 of the Lesson 28 Notes. With formulas for and , the same intervals and points are found by algebra.
On an interval where is defined, continuous, and never zero, has one sign. As a result, the sign of at a single test input in such an interval is the sign of on the whole interval. The same is true of .
Characterizing a function from and .
- Find the inputs where or where does not exist, and evaluate at one test input in each interval those inputs mark off. The function is increasing on an interval with a positive test value and decreasing on an interval with a negative test value.
- At each input where is continuous, report a local maximum where changes from positive to negative and a local minimum where changes from negative to positive. Substitute each such input into for the value.
- Find the inputs where or where does not exist, and evaluate at one test input in each interval those inputs mark off. The function is concave up on an interval with a positive test value and concave down on an interval with a negative test value.
- Report a point of inflection at each input where the sign of changes and is continuous.
Examples 1 and 2 give and in the stem. The rules for finding them from a formula for are in sections 2 to 4.
Example 1
The function
has first and second derivatives
Determine where is increasing and decreasing, its local extrema, its concavity, and its points of inflection.
ShowHide solution
Because the derivative exists at every input, is continuous everywhere. By the sign test for local extrema (Lesson 28 Notes, section 3), has a local extremum at each input where the sign of changes. The factors of are zero at and . Evaluate at one input in each interval those inputs mark off:
The function is increasing for and for , and decreasing for . Because changes from positive to negative at and from negative to positive at , has a local maximum at and a local minimum at . Substitute each input into for the values:
The second derivative is zero at . Evaluate at one input on each side:
The function is concave down for and concave up for . Because changes sign at , the point is a point of inflection, with
On the graph of , the local maximum is the height of the peak at , and the local minimum is the height of the valley at . At the point of inflection , the graph changes from concave down to concave up.
Example 2
The function
has first and second derivatives
Determine where is increasing and decreasing, its local extrema, its concavity, and its points of inflection.
ShowHide solution
The factors of are zero at and . Evaluate at one input in each interval those inputs mark off:
Thus, is decreasing for and for , and increasing for . The polynomial is continuous everywhere. Because is negative on both sides of , has no local extremum at . The sign of changes from negative to positive at . By the sign test for local extrema, has a local minimum there:
The factors of are zero at and . Evaluate at one input in each interval:
The function is concave up for and for , and concave down for . The concavity changes at both inputs, and the points of inflection are and , with
On the graph of , the tangent line at is horizontal, yet keeps decreasing to the local minimum at . The concavity changes at and .
2. The Power Rule
Objective. Find derivatives of basic power functions using the power rule, by hand.
Rule 1 (Constant rule).
For every real number , the derivative of the constant function is 0,
For constants and , the derivative of the linear function is its slope, , because the tangent line to a line at every input is the line itself.
Rule 2 (Power rule).
For every real number ,
for every with , for every when is a positive integer, and for every with when is a negative integer.
Why it works: the power rule for a positive integer
For a positive integer , every pair of numbers and satisfies the factoring
Substitute and into the factoring. The quotient in the limit definition of the derivative (Lesson 26 Notes, section 4) becomes
for . The right side has terms, and each approaches as . The limit is therefore . For other the rule can fail at . For example, the function has no derivative at 0, and the formula gives no value there.
Rewriting as a power. The power rule applies to only. Before the power rule is applied, a root becomes a power with a fractional exponent, and 1 over a power becomes a power with a negative exponent. For integers and with , and every real number ,
When is an integer, the second rewrite is true for every with . Combine a product or quotient of powers of into one power first: add the exponents of factors that multiply, and subtract the exponent of a factor that divides. The power rule applies to the single power that results.
Example 3
Find the derivatives:
ShowHide solution
Rewrite each function as a power , then apply the power rule .
The first function, 1 over a power, becomes a power with a negative exponent, :
for every with . The rewrite is true for these inputs because the exponent is an integer.
The root in the second function becomes a power with a fractional exponent, :
for every with . The rewriting lead gives the rewrite for these inputs.
Apply both rewrites to the third function. The root is , and 1 over that power becomes a power with a negative exponent, :
for every with . The rewriting lead gives both rewrites for these inputs.
Example 4
Find the derivative:
ShowHide solution
Write the root as and combine the exponents into one power:
Apply the power rule:
for every with . The rewriting lead gives the rewrites for these inputs.
The words estimate and find. “Estimate ” asks for the average rate of change over a short interval. “Find” or “compute” asks for the value of the derivative itself, from a derivative rule by hand or from D() in R.
Example 5
For the function
estimate with an interval of width 0.001, then compute exactly.
ShowHide solution
Estimate with the average rate of change from 2 to 2.001:
Rewrite and apply the power rule for the exact value:
The estimate is within 0.001 of the exact value. The exact value is the slope of the tangent line to the graph of at , and the estimate is the slope of a secant line close to it.
3. Basic Modeling Functions
Objective. Find derivatives of basic modeling functions by hand (exponential, sinusoidal, logarithmic, etc.).
Definition 3 (Basic modeling functions).
The basic modeling functions are the simplest forms of the modeling functions. For constants , , and and a constant with , they are
The function is not a basic modeling function, because it multiplies two basic modeling functions together and is none of the forms in the definition. Lesson 30 differentiates products.
The sine and cosine rules below hold for in radians, the textbook’s unit for angles.
Rule 4 (Derivatives of basic modeling functions).
For a constant with and constants and , the basic modeling functions have these derivatives:
Linear exponent. The extended exponential rule applies when the exponent is linear in . Differentiating or , where the exponent is not linear, takes the chain rule (Lesson 32).
Power or exponential. In a power function the variable is the base, as in , and the power rule applies. In an exponential function the variable is the exponent, as in , and the exponential rule applies. Thus and .
Constant expressions. An expression with no in it, such as , , , or , is a constant with derivative 0.
Example 6
Find the derivatives:
ShowHide solution
- By the exponential rule, .
- By the power rule, .
- By the extended exponential rule with , .
- By the cosine rule, .
- Because is a constant, .
Example 7
Find each derivative and evaluate it at the given input:
ShowHide solution
- By the logarithm rule, . At the derivative is .
- By the sine rule, . At the derivative is .
- By the exponential rule, . At the derivative is .
Example 8
Determine which of these functions are differentiated with the power rule:
ShowHide solution
The functions and are differentiated with the power rule, because in each the variable is the base and the exponent is a constant. The function is differentiated with the exponential rule, because the variable is the exponent. The function is differentiated with the extended exponential rule, because its exponent is linear in . The function is differentiated with the logarithm rule, because it is the natural logarithm.
4. Linear Combinations
Objective. Compute derivatives of linear combinations using the constant, constant-multiple, and sum/difference rules.
Rule 5 (Constant multiple rule).
For a real number and a differentiable function ,
Rule 6 (Sum and difference rules).
For differentiable functions and ,
Definition 7 (Linear combination).
A linear combination of functions is a sum of constant multiples of the functions, such as .
The function is not a linear combination of and , because it is a product of the two functions, and the definition allows only a sum of constant multiples. Products are differentiated in Lesson 30.
With the constant multiple rule and the sum and difference rules, a linear combination is differentiated one term at a time. A constant term has derivative 0 by the constant rule (section 2).
Example 9
Find :
ShowHide solution
Rewrite as . By the definition of a linear combination, is a sum of constant multiples of , , , , , and the constant function 1. The term is a number times the constant function 1; the 3 in the Lesson 17 non-example is a scalar with no vector. Differentiate term by term with the constant multiple rule, the sum and difference rules, the power, sine, logarithm, and exponential rules, and the constant rule for :
Example 10
Name the rules needed to differentiate , then find :
ShowHide solution
Rewrite the first term as a constant times a power:
The rules needed are the constant multiple rule, the power rule, the sum and difference rules, and the exponential rule. Apply them term by term:
Example 11
Find the first four derivatives of the function
ShowHide solution
Differentiate each derivative to get the next one:
The third and fourth derivatives are written and , the th-derivative notation of the Lesson 28 Notes, section 2.
Example 12
For a constant in meters per second and a constant in meters, a projectile’s height in meters seconds after launch is
Find the velocity and the acceleration , the rate of change of the velocity, with units.
ShowHide solution
By the constant multiple rule and the power rule, has derivative , and has derivative . The constant has derivative 0:
Differentiate the same way. The term has derivative , and the constant has derivative 0:
The velocity is in meters per second, and the acceleration is in meters per second per second.
5. Derivatives in R
Objective. In R, use D() to find the derivative of a function.
The command D(formula ~ x) differentiates the left side of the tilde with respect to and returns the derivative as a function. The left side is either an expression in or a stored function written as f(x).
A derivative stored under a name such as df is evaluated and plotted the same way as a function from makeFun.
To find the second derivative, write the variable twice after the tilde, as in d2f = D(f(x) ~ x & x).
The natural logarithm and in R. The natural logarithm is log(x), and is exp(x). A call to ln() gives an error:
> ln(2) Error in ln(2) : could not find function "ln"
When is typed as e^ x, R treats the letter e as a second input of the derivative. Evaluating the derivative at one input then gives an error:
> de = D(e^ x ~ x) > de(1) Error in de(1) : argument "e" is missing, with no default
Example 13
For the function
find , , and in R.
ShowHide solution
Differentiate the expression with D() to see . Then store and its first and second derivatives, evaluate at , and evaluate at . Used R.
D(x^3 - 5*x ~ x) function (x) 3 * x^2 - 5 f = makeFun(x^3 - 5*x ~ x) df = D(f(x) ~ x) df(0) [1] -5 d2f = D(f(x) ~ x & x) d2f(1) [1] 6
R prints function (x) and then the body 3 * x^2 - 5, its spelling of . The calls df(0) and d2f(1) give and . As a check by hand, and give
Example 14
For the function
find and by hand, and check both in R.
ShowHide solution
The constant multiple rule, the difference rule, the logarithm rule, and the exponential rule give
Differentiating again, with and the power rule, gives
Check both values in R. The command D() returns and as functions, and evaluating them at 1 gives the values to more digits. Used R.
g = makeFun(6*log(x) - 3*exp(x) ~ x) dg = D(g(x) ~ x) dg(1) [1] -2.154845 d2g = D(g(x) ~ x & x) d2g(1) [1] -14.15485
R’s values agree with the hand values and .
Example 15
Find in R:
ShowHide solution
Differentiate with D() and evaluate the derivative at . Used R.
dq = D(log(5) + 3*x^4 - exp(x) + sin(x) ~ x) dq(pi) [1] 347.9346
Therefore . As a check, the derivative by hand, , gives .
Found a mistake, a broken tool or something unclear? Report a problem