Chain Rule
The chain rule tells how change moves through composed functions.
If:
then:
Meaning
If x changes g, and g changes y, then x changes y through both
steps.
The total sensitivity is the product of local sensitivities.
The chain rule is not only a formula. It is a way to break a large sensitivity question into small local questions.
This is why it scales to neural networks. A large model may be complicated, but each operation can expose a small local derivative. The total sensitivity is built by combining those local pieces.
Small Example
Let:
Then:
At x = 3, g = 6.
The local derivatives are:
So:
We can check by expanding:
So:
At x = 3, this is 24, matching the chain-rule calculation.
If dy/dg = 5 and dg/dx = 4, what is dy/dx?
Compute it first, then check your number.
Hint
Multiply the local sensitivities.
Solution
The chain rule multiplies the sensitivity of y to g by the sensitivity of
g to x:
dy/dx
= (dy/dg)(dg/dx)
= 5 * 4
= 20
So a small change in x is amplified by both local rates.
Let g(x) = 3x and y = g^2.
At x = 2, what is dy/dx?
Compute it first, then check your number.
Hint
At x = 2, g = 6. Use (dy/dg)(dg/dx).
Solution
At x = 2, the inner value is g = 3x = 6.
Since y = g^2, the local sensitivity is dy/dg = 2g = 12.
The inner function has sensitivity dg/dx = 3.
Multiplying the local sensitivities gives:
dy/dx = 12 * 3 = 36
If dy/dg = 0 and dg/dx = 10, what is dy/dx?
Compute it first, then check your number.
Hint
Multiply the local rates.
Solution
The chain rule gives:
dy/dx = 0 * 10 = 0
Even though g changes strongly with x, y is locally insensitive to g.
That zero local sensitivity blocks this path.
Does the chain rule combine local sensitivities along a path?
Answer it first, then check.
Hint
Each factor is one local sensitivity.
Solution
Yes. Each factor in the chain rule describes one local step in the composed
function. Multiplying them tells how sensitivity travels through the whole
path from x to y.
Enter 1 if the chain rule lets us compute a large sensitivity by combining
small local sensitivities.
Compute it first, then check your number.
Hint
Think of a long computation as many small operations.
Solution
Enter 1. The chain rule breaks a large sensitivity into local sensitivities
and multiplies them along a path.
Before Moving On
The chain rule is the core mechanism behind backpropagation.