The Chain Rule
Finding derivatives of compositions of functions.
June 23, 2017—Dan Uhlman
Basic Compositions of Functions
You have already worked with derivative rules for many functions.
Find the derivatives for
s
i
n
(
x
)
,
5
x
,
l
n
(
x
)
and
x
e
:
I
n
[
]
:
=
D
[
S
i
n
[
x
]
,
x
]
O
u
t
[
]
=
c
o
s
(
x
)
I
n
[
]
:
=
D
[
5
x
,
x
]
O
u
t
[
]
=
5
4
x
I
n
[
]
:
=
D
[
L
o
g
[
x
]
,
x
]
(
*
n
o
t
e
t
h
a
t
l
n
(
x
)
i
s
i
n
p
u
t
a
s
L
o
g
[
x
]
i
n
W
L
*
)
O
u
t
[
]
=
1
x
I
n
[
]
:
=
D
[
x
,
x
]
O
u
t
[
]
=
x
A composition of functions is one function put inside another, such as
s
i
n
(
2
x
)
.
The
2
x
function is put inside the
s
i
n
(
x
)
function. Our first guess at the derivative of
s
i
n
(
2
x
)
would probably be
c
o
s
(
2
x
)
.
What does the
Wolfram Language
say is the derivative of
s
i
n
(
2
x
)
?
I
n
[
]
:
=
D
[
S
i
n
[
2
x
]
,
x
]
O
u
t
[
]
=
2
c
o
s
(
2
x
)
Our guess was partly correct; the answer does contain
c
o
s
(
2
x
)
, but also has an extra factor of
2
. Let’s try another example.
Find the derivative of
s
i
n
(
3
x
)
:
I
n
[
]
:
=
D
[
S
i
n
[
3
x
]
,
x
]
O
u
t
[
]
=
3
2
x
c
o
s
(
3
x
)
Again, we expected to see
c
o
s
(
3
x
)
, but there is another “extra” factor of
3
2
x
.
Can we predict where this extra factor is coming from?
Here are three more examples to help us with our prediction:
I
n
[
]
:
=
D
[
S
i
n
[
1
4
x
]
,
x
]
O
u
t
[
]
=
1
4
1
3
x
c
o
s
(
1
4
x
)
I
n
[
]
:
=
D
[
S
i
n
[
L
o
g
[
x
]
]
,
x
]
O
u
t
[
]
=
c
o
s
(
l
o
g
(
x
)
)
x
A note about logarithms in the Wolfram Language: In the Wolfram Language,
l
o
g
(
x
)
is the same as
l
n
(
x
)
, the natural logarithm. The Wolfram Language uses
L
o
g
1
0
[
x
]
for
l
o
g
1
0
(x).
I
n
[
]
:
=
D
[
7
x
,
x
]
O
u
t
[
]
=
7
7
x
Notice that the argument of the “outside” function remains unchanged (the
7
x
part in the last example).
Predict each derivative, then calculate the answer:
I
n
[
]
:
=
D
[
S
i
n
[
x
]
,
x
]
I
n
[
]
:
=
D
[
S
i
n
[
T
a
n
[
x
]
]
,
x
]
I
n
[
]
:
=
D
[
5
x
,
x
]
I
n
[
]
:
=
D
[
S
i
n
[
x
]
,
x
]
I
n
[
]
:
=
D
[
4
(
S
i
n
[
x
]
)
,
x
]
You might describe this rule to a friend as: Take the derivative of the outside function, then multiply by the derivative of the inside function.
Find the derivative of
g
(
2
x
)
:
I
n
[
]
:
=
D
[
g
[
2
x
]
,
x
]
O
u
t
[
]
=
2
x
′
g
(
2
x
)
Using function notation, a composition of functions can be written as
f
(
g
(
x
)
)
.
Predict the derivative of
f
(
g
(
x
)
)
and then calculate the answer:
I
n
[
]
:
=
D
[
f
[
g
[
x
]
]
,
x
]
O
u
t
[
]
=
′
g
(
x
)
′
f
(
g
(
x
)
)
Notice that this answer is the derivative of
f
(with the same argument) multiplied by the derivative of g. This is called the chain rule:
x
f
(
g
(
x
)
)
=
′
g
(
x
)
′
f
(
g
(
x
)
)
Intermediate Examples
Multiple Applications of the Chain Rule
Challenge Yourself
FURTHER EXPLORATIONS
Using the Chain Rule with the Product Rule
Using the Chain Rule with the Quotient Rule
AUTHORSHIP INFORMATION
Dan Uhlman
6/23/17