Composite Functions (Chain Rule)

Chain Rule
When finding the derivative of a composite function, we need to use the chain rule. There are two ways for us to write out the chain rule--Lagrange & Leibniz notation.
Lagrange Notation:
If f′ and g′ both exist, then the derivative of the composite function h(x)=f(g(x)) is h′(x)=f′(g(x))×g′(x).
Leibniz notation:
If y is a function of u, and u is a function of x, then the derivative of y in terms of x is dxdy=dudy×dxdu.
Power of a Function rule
This is just a special case of the chain rule:
If h(x)=[f(x)]n, then h′(x)=n[f(x)]n−1×f′(x).
Example
Find the derivative of f(x)=3(2−3x4)2.
Rewrite: f(x)=(2−3x4)32
Use the power of a function rule (special case of the chain rule) to find the derivative:
f′(x)=32(2−3x4)−31×(2−3x4)′
f′(x)=32(2−3x4)−31×(−12x3)
Simplify:
f′(x)=−8x3(2−3x4)−31
f′(x)=−32−3x48x3

Example: Chain Rule & Product Rule
Find the derivative of y=(2−x)(x5−x)1 at x=3 by using the chain rule.
We first rewrite this as y=[(2−x)(x5−x)]−1.
Using chain rule:
y′ or dxdy=−1[(2−x)(x5−x)]−2×[(2−x)(x5−x)]′
y′ or dxdy=−1[(2−x)(x5−x)]−2×[(2−x)′(x5−x)+(2−x)(x5−x)′]
y′ or dxdy=−1[(2−x)(x5−x)]−2×[(−1)(x5−x)+(2−x)(5x4−1)]
y′ or dxdy=−[(2−x)(x5−x)]21×[−(x5−x)+(2−x)(5x4−1)]
At x=3:
y′(3)=−[(2−3)(35−3)]21×[−(35−3)+(2−3)(5(3)4−1)]
y′(3)=−[−(240)]21×[−(240)−(404)]
y′(3)=−24021×(−644)
y′(3)=2402644

Example: Chain Rule & Leibniz Notation
Given y=2u3−u+1 and u=x2−1, find dxdy at x=1.
Using Leibniz notation:
dxdy=dudy×dxdu
dxdy=dud[2u3−(u+1)21]×dxd[x2−1]
dxdy=[6u2−21(u+1)−21×(1)′]×[2x]
Sub in u=x2−1:
dxdy=[6(x2−1)−21((x2−1)+1)−21×(1)]×[2x]
Simplify:
dxdy=[6x2−6−21(x2)−21]×[2x]
dxdy=[6x2−6−2x1]×[2x]
dxdy=12x3−12x−1
Sub in x=1:
dxdy∣x=1=12(1)3−12(1)−1
dxdy∣x=1=−1
Practice: Chain Rule & Leibniz Notation
Given y=3u and u=2x4−x, find the derivative dxdy at x=1.

Example: Multiple Chain Rules
a) Find the derivative of f(x)=x+(2−x31)2 at x=1
Rewrite: f(x)=[x+(2−x31)2]21
Using chain rule:
f′(x)=21[x+(2−x31)2]−21×[x+(2−x31)2]′
f′(x)=21[x+(2−x31)2]−21×[1+[(2−x31)2]′]
f′(x)=21[x+(2−x31)2]−21×[1+[2(2−x31)×(2−x31)′]]
f′(x)=21[x+(2−x31)2]−21×[1+[2(2−x31)×(−31x−32)]]
f′(x)=2x+(2−x31)21×[1−32x−32(2−x31)]
f′(x)=2x+(2−x31)21×1−3x322(2−x31)
f′(1)=21+(2−131)21×1−3(1)322(2−131)
f′(1)=221×[1−32]
f′(1)=221×[31]
f′(1)=621
b) Find the derivative dxdy at x=1, given that y=u2+1 and u=2−(3−x3)21.
Using chain rule:
dxdy=dudy×dxdu
dxdy=dud[u2+1]×dxd[2−(3−x3)21]
dxdy=dud[(u2+1)21]×dxd[(2−(3−x3)2)−1]
dxdy=[21(u2+1)−21×(u2+1)′]×[−(2−(3−x3)2)−2×(2−(3−x3)2)′]
dxdy=[21(u2+1)−21×(2u)]×[−(2−(3−x3)2)−2×(0−2(3−x3)×(3−x3)′)]
dxdy=[21(u2+1)−21×(2u)]×[−(2−(3−x3)2)−2×(−2(3−x3)×(−3x2))]
dxdy=[u2+1u]×−[2−(3−x3)2]26x2(3−x2)
When x=1, u=2−(3−13)21=−21:
dxdy∣x=1=(−21)2+1−21×−[2−(3−13)2]26(1)2(3−12)
dxdy∣x=1=45−21×[−412]
dxdy∣x=1=[25−21]×[−412]
dxdy∣x=1=[−51]×[−3]
dxdy∣x=1=53
Practice: Multiple Chain Rules
Find the derivative of f(x)=x+x4+x3+x2+1 at x=0

Example: Chain Rule
Given that g(x)=f([f(x)]2), f(1)=1 and f′(1)=3, find g′(1).
The g function is a function wrapped inside another, wrapped inside another, so we need chain rule:
g′(x)=f′([f(x)]2)×2f(x)×f′(x)
Now we sub in x=1:
g′(1)=f′([f(1)]2)×2f(1)×f′(1)
Now we substitute the known given values
g′(1)=f′([1]2)×2(1)×(3)
g′(1)=f′(1)×2×3
g′(1)=3×2×3
g′(1)=18