Calculus

Chain Rule

Derivatives of composed functions multiply: small changes propagate through a chain of dependencies.

status: reviewimportance: criticaldifficulty 2/5math: undergraduateread: 6mlive demo

Concept Structure

Chain Rule

01Intuition

Start with the picture, metaphor, or geometric mechanism.

02Math

Make the objects explicit and connect them with notation.

03Code

Mirror the equations with runnable implementation details.

04Interactive Demo

Manipulate the mechanism and watch the idea respond.

1prerequisites
1next concepts
2related links

Learner Contract

What this page should let you do.

You are here becauseDerivatives of composed functions multiply: small changes propagate through a chain of dependencies.

This Calculus concept is the current object: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.

Before thisDerivatives

1 prerequisite listed; refresh them before leaning on the math or code.

By the end4/4 sections ready | code witness expected | live demo

Explain the mechanism, trace the main notation, and test one prediction in the live demo.

Do this firstIntuition

Read the intuition before the notation; the math should name a mechanism you already felt.

Then go nextComputation Graphs

Follow this edge after making one prediction here; the next page should reuse the result, not restart the route.

Test the linkManipulate one control and predict the visible change.Then continue to Computation Graphs

Claim/source review status

Claim review not recorded

No structured claim checks yet; source metadata is not enough to establish support.Metadata-derived; review may be AI-assisted. Not a human certification.
Claims0/0 reviewed
Sources0 cited
Codeattached
Demolive
Reviewednot recorded
Updatedpage 2026-06-29

Object flow

4/4 sections readyAsk about thisResearch room
ConceptChain RuleCalculus
Local snapshot ready
concept:calculus/chain-rule
01

01

Intuition

Build the mental picture first so the rest of the page has something to attach to.

Section prompt

When a quantity depends on an intermediate variable, change propagates through the chain.

If a tiny change in xx causes a change in uu, and that change in uu causes a change in yy, then the total change from xx to yy multiplies those effects.

That is the entire story of backpropagation: derivatives flow through a computational graph by repeatedly applying the chain rule.

02

02

Math

Translate the story into symbols, assumptions, and a derivation you can inspect.

Section prompt

Let u=g(x)u = g(x) and y=f(u)=f(g(x))y = f(u) = f(g(x)). The chain rule says:

(fg)(x)=f(g(x))g(x).(f \circ g)'(x) = f'(g(x))\, g'(x).

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 same idea becomes matrix multiplication between local Jacobians. The later autodiff pages turn this into forward and reverse passes; here, the important invariant is just that local rates multiply along a dependency chain.

03

03

Code

Keep the implementation aligned with the notation so the algorithm is legible.

Section prompt
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

04

Interactive Demo

Use direct manipulation to connect the explanation to a moving system.

Section prompt

Use the live witness below: the forward values are visible, but the local rates are hidden. Predict whether a tiny positive move in xx raises, lowers, or barely changes yy for

u=x2,y=sin(u).u=x^2,\qquad y=\sin(u).

Then reveal du/dxdu/dx, dy/dudy/du, their product dy/dxdy/dx, a forward finite-step check, and a central-slope check. Try the presets after the default case: one link can flip the sign, and one nearly stopped link can gate the first-order chain even when a finite step still shows a tiny second-order change.

Live Concept Demo

Explore Chain Rule

The stage is code-native and interactive. Use it to test the explanation against the mechanism.

difficulty 2/5undergraduatecode-aligned
Demo Prediction Checkpoint

Manipulate one control and predict the visible change.

Commit to what Chain Rule should make visible before reading the result.

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.

Prediction open01 / Intuition
Prediction lens

Start with the picture, metaphor, or geometric mechanism.

Commit first

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.

4/4 stages readyLive demo connected
Prediction

Which visible object should carry the first intuition?

Commit first

Pick the cue that should make Chain Rule easier to reason about before the page gives the answer.

Source Grounding

Canonical references for the mechanism on this page.

Source gapNo canonical references are listed yet.

Add source metadata before treating this page as source-grounded.

Claim Review

Derivatives of composed functions multiply: small changes propagate through a chain of dependencies.

StatusSubstantive claim review pending

Source IDs and witness objects are attached for review; they are not proof by themselves.

SourcesNo references

Add source metadata before claiming support.

Witnesses3 local objects

Use equation, code, and demo objects to check whether the source support is operational.

Practice Loop

Try the idea before it explains itself

Derivatives of composed functions multiply: small changes propagate through a chain of dependencies.

Readiness0/3 checks ready
Predict

Before touching the demo, predict one visible change that should happen in Chain Rule.

Hint 1

Reveal when your model needs a nudge.

Hint 2

Reveal when your model needs a nudge.

Hint 3

Reveal when your model needs a nudge.

Object research drawerClose
ConceptChain RuleCalculus

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.
Next local actionNo local draft saved yet

Open the draft below to save one note and next action in this browser.

conceptCalculus

Chain Rule

Anchored question

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
Local action draft

This draft stays locally in this browser for concept:calculus/chain-rule.

No local draft saved.
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
Grounded AI handoff

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.

Open source object
concept/concept-notebook/calculus/chain-rule concept:calculus/chain-rule