Bring the mental model from Derivatives; this page will reuse it instead of restarting from zero.
Calculus
Chain Rule
Derivatives of composed functions multiply: small changes propagate through a chain of dependencies.
Concept Structure
Chain Rule
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learning map
Chain RuleConceptual Bridge
What should feel connected as you move through this page.
Derivatives of composed functions multiply: small changes propagate through a chain of dependencies.
The next edge should feel earned: use the demo prediction here before following Computation Graphs.
01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
When a quantity depends on an intermediate variable, change propagates through the chain.
If a tiny change in causes a change in , and that change in causes a change in , then the total change from to multiplies those effects.
That is the entire story of backpropagation: derivatives flow through a computational graph by repeatedly applying the chain rule.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Let and . The chain rule says:
A useful way to remember it is “differentiate the outside, then multiply by the derivative of the inside.”
For multi-variable functions (what we use in ML), the chain rule becomes Jacobian multiplication. Forward-mode autodiff computes Jacobian-vector products; reverse-mode backprop computes vector-Jacobian products, which is why it works well when one scalar loss depends on many parameters.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import torch
x = torch.tensor(1.5, requires_grad=True)
# y = f(g(x)) with g(x)=x^2 and f(u)=sin(u)
y = torch.sin(x**2)
y.backward()
print("dy/dx (autograd):", x.grad.item())
# Analytic chain rule: f'(u)=cos(u), g'(x)=2x
analytic = torch.cos(x**2) * (2 * x)
print("dy/dx (analytic):", analytic.item())
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
No interactive demo yet. A great demo: a small computation graph with sliders, showing local derivatives on edges and the product along a path.
No live visualization is registered for this concept yet.
The page still supports explanatory demo notes above; when a viz.tsx exists, it will render here without changing the route.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
Derivatives of composed functions multiply: small changes propagate through a chain of dependencies.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Chain Rule should make visible.
Visual Inquiry
Make the image answer a mathematical question
Derivatives of composed functions multiply: small changes propagate through a chain of dependencies.
Which visible object should carry the first intuition?
Pick the cue that should make Chain Rule easier to reason about before the page gives the answer.
Claim Review
Derivatives of composed functions multiply: small changes propagate through a chain of dependencies.
Source IDs and witness objects are attached for review; they are not proof by themselves.
Add source metadata before claiming support.
Use equation, code, and demo objects to check whether the source support is operational.
Source support candidates
No structured source note is attached yet.
Practice Loop
Try the idea before it explains itself
Derivatives of composed functions multiply: small changes propagate through a chain of dependencies.
Before touching the demo, predict one visible change that should happen in Chain Rule.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to an exact object
Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.Open the draft below to save one note and next action in this browser.
Chain Rule
What is the smallest example that makes Chain Rule click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays locally in this browser for concept:calculus/chain-rule.
- Definition, prerequisite, and contrast concept links
- The equation or code witness that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Chain Rule Object key: concept:calculus/chain-rule Context: Calculus Anchor id: concept/concept-notebook/calculus/chain-rule Open question: What is the smallest example that makes Chain Rule click without losing the math? Evidence to inspect: - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.
concept/concept-notebook/calculus/chain-rule
concept:calculus/chain-rule