- Practice
- About 20 min
- 5 practice questions
Chain rule in practice, implicit and logarithmic differentiation
Differentiate composite functions with the chain rule, find dy/dx when y is defined implicitly, and use logarithmic differentiation for products, quotients and powers such as xˣ.
If something looks wrong, please tell us.
By the end of this lesson you can
- Identify the outer and inner functions and apply the chain rule, more than once if needed.
- Differentiate an equation F(x, y) = 0 implicitly and solve for dy/dx.
- Use logarithmic differentiation for power-exponential functions and for long products and quotients.
- Know the four cases of differentiating a power: constant or variable base, constant or variable index.
Most functions met in practice are built by putting one function inside another, and many curves (like circles) are given by an equation in x and y rather than y = f(x). This lesson collects the methods the textbook uses for such cases. All of them are the chain rule in different clothes.
Using the chain rule
To differentiate y = f(g(x)), name the inner function u = g(x), differentiate the outer function with respect to u, then multiply by du/dx. With practice the substitution is done mentally.
Worked example 1: four quick chain rules
- y = (3x² − 5)⁴. Outer: u⁴, inner: u = 3x² − 5. dy/dx = 4u³ × 6x = 24x(3x² − 5)³.
- y = cos(x³). Outer: cos u, inner: u = x³. dy/dx = −sin(x³) × 3x² = −3x² sin(x³).
- y = cos³x = (cos x)³. Outer: u³, inner: u = cos x. dy/dx = 3cos²x × (−sin x) = −3 cos²x sin x. Compare with the previous line: where the power sits decides which function is outside.
- y = √(1 + x²) = (1 + x²)^(1/2). dy/dx = (1/2)(1 + x²)^(−1/2) × 2x = x/√(1 + x²).
Worked example 2: a chain inside a chain
Differentiate y = e^(tan 2x). Here there are three layers: e^u with u = tan v and v = 2x. So dy/dx = e^(tan 2x) × sec²(2x) × 2 = 2 sec²(2x) e^(tan 2x). Each layer contributes one factor, working from the outside in. In the same way, y = log(sin x) gives (1/sin x) × cos x = cot x.
Implicit differentiation
A function given as y = f(x) is explicit. An equation such as x² + y² = 4 defines y implicitly: it is not itself a function (each x between −2 and 2 gives two values of y), but it contains two functions, y = √(4 − x²) (the top half of the circle) and y = −√(4 − x²) (the bottom half). Often we cannot solve for y at all, as with x³ + y³ = 3xy. Implicit differentiation gets dy/dx anyway: differentiate both sides with respect to x, treating y as a function of x, so that by the chain rule d/dx(yⁿ) = n yⁿ⁻¹ (dy/dx); then solve for dy/dx.
Worked example 3: slope on a circle
Find the slope of x² + y² = 25 at (3, 4) and at (3, −4). Differentiate: 2x + 2y (dy/dx) = 0, so dy/dx = −x/y. At (3, 4): −3/4. At (3, −4): 3/4. The one formula gives the correct slope on both halves of the circle, even though the two points lie on different implicit functions.
Worked example 4: when y cannot be isolated
Find dy/dx if x³ + y³ = 3xy. Differentiate each term, using the product rule on 3xy: 3x² + 3y² y′ = 3(x y′ + y · 1). Divide by 3: x² + y² y′ = x y′ + y. Collect the y′ terms: y′(y² − x) = y − x². So dy/dx = (y − x²)/(y² − x), provided y² ≠ x. The answer contains y, which is normal for implicit differentiation.
Logarithmic differentiation
The rules so far cannot handle y = xˣ, where both the base and the index vary: it is neither a power xⁿ nor an exponential aˣ. Taking the natural logarithm turns powers into products and products into sums, after which implicit differentiation finishes the job. The derivative (1/y)(dy/dx) of log y is called the logarithmic derivative.
Steps in logarithmic differentiation
- Take log of both sides log y = log f(x); expand with the laws of logarithms.
- Differentiate implicitly The left side gives (1/y) y′.
- Solve for y′ Multiply through by y.
- Substitute back Replace y by the original expression f(x).
Worked example 5: a power-exponential function
Differentiate y = x^(sin x), x > 0. Take logs: log y = sin x · log x. Differentiate, using the product rule on the right: (1/y) y′ = cos x · log x + sin x · (1/x). Multiply by y: y′ = x^(sin x) [cos x log x + (sin x)/x]. With the same method, y = xˣ gives log y = x log x, (1/y)y′ = log x + 1, so y′ = xˣ(1 + log x).
Worked example 6: a long product and quotient
Differentiate y = (x + 1)² √(x − 2) / (x + 4)³, x > 2. Take logs: log y = 2 log(x + 1) + (1/2) log(x − 2) − 3 log(x + 4). Differentiate: y′/y = 2/(x + 1) + 1/[2(x − 2)] − 3/(x + 4). So y′ = [(x + 1)² √(x − 2)/(x + 4)³] × [2/(x + 1) + 1/(2(x − 2)) − 3/(x + 4)]. Doing this with the quotient and product rules would take far longer.
| Form | Derivative | Method |
|---|---|---|
| aᵇ | 0 | constant |
| [f(x)]ᵇ | b [f(x)]ᵇ⁻¹ f′(x) | power rule with chain rule |
| a^g(x) | a^g(x) log a · g′(x) | exponential rule with chain rule |
| [f(x)]^g(x) | [f(x)]^g(x) [g′(x) log f(x) + g(x) f′(x)/f(x)] | logarithmic differentiation |
Key takeaways: in the chain rule, one factor per layer, from the outside in; in implicit differentiation every term in y picks up a factor y′; logarithmic differentiation is the only route for [f(x)]^g(x) and a shortcut for messy products and quotients.
Check your understanding
-
1. What is d/dx (2x + 1)⁶?
- 6(2x + 1)⁵
- 12(2x + 1)⁵
- 12(2x + 1)⁶
- (2x + 1)⁵
Show answer
Answer: B. Chain rule: 6(2x + 1)⁵ × d/dx(2x + 1) = 6(2x + 1)⁵ × 2 = 12(2x + 1)⁵. Leaving out the inner derivative 2 gives 6(2x + 1)⁵.
-
2. What is d/dx sin(5x)?
- cos 5x
- 5 sin 5x
- −5 cos 5x
- 5 cos 5x
Show answer
Answer: D. Outer function sin u, inner u = 5x. Derivative = cos(5x) × 5 = 5 cos 5x.
-
3. The point (1, 2) lies on x² + xy + y² = 7. What is dy/dx there?
- −4/5
- −5/4
- 4/5
- −1
Show answer
Answer: A. Check: 1 + 2 + 4 = 7. Differentiating: 2x + (x y′ + y) + 2y y′ = 0, so y′(x + 2y) = −(2x + y) and y′ = −(2x + y)/(x + 2y). At (1, 2): −(2 + 2)/(1 + 4) = −4/5.
-
4. What is the derivative of xˣ (x > 0)?
- x · xˣ⁻¹
- xˣ log x
- xˣ(1 + log x)
- xˣ
Show answer
Answer: C. log y = x log x, so y′/y = log x + x(1/x) = log x + 1, and y′ = xˣ(1 + log x). Treating it as a power (x · xˣ⁻¹ = xˣ) or as an exponential (xˣ log x) each misses one of the two terms.
-
5. What is d/dx log(cos x), for cos x > 0?
- −tan x
- tan x
- 1/cos x
- −cot x
Show answer
Answer: A. Chain rule: (1/cos x) × (−sin x) = −sin x/cos x = −tan x.
Sign in to keep track of the lessons you finish.