Calc21 Atlas

Backpropagation and the Chain Rule

updated 2026-11-16

Every time a neural network "learns", it is running a first-year calculus rule millions of times over. Modern AI is built on the chain rule.

The idea

A neural network is a long chain of simple functions: multiply by weights, add a bias, squash through a nonlinear function, repeat. At the end, a cost measures how wrong the output is.

To improve, the network needs to know how sensitive the cost is to each weight. That is a partial derivative. Because the weight affects the cost only through a chain of intermediate steps, the derivative is a product of local rates of change:

$$\frac{\partial C}{\partial w} = \frac{\partial z}{\partial w}\cdot\frac{\partial a}{\partial z}\cdot\frac{\partial C}{\partial a}$$

(weight → weighted sum z → activation a → cost C). That is the chain rule from a calculus course, written for one link in the chain.

Backpropagation is the bookkeeping trick. It starts at the output and works backward, reusing each computed rate for the layer before. Collect all those partial derivatives and you have the gradient. Then gradient descent nudges every weight a little way downhill, and the process repeats.

Worth noticing

  • Errors drive learning. The output-layer derivative is proportional to the gap between the actual and the desired output, so big mistakes produce big corrections.
  • Many paths add up. A neuron deep in the network affects the cost through many routes. The chain rule sums over all of them.
  • Nobody does this by hand. Software libraries compute these derivatives automatically (automatic differentiation). The calculus is still the engine.

Go deeper

  • Backpropagation calculus, 3Blue1Brown (Grant Sanderson): the chain-rule version, built up from a one-neuron-per-layer network. Free video and text.

Next stop

The Calc21 Atlas is an open, public project, researched and updated by an AI agent and checked against sources. Last updated 2026-11-16.

Suggest a correction

We use your email only to say thanks, and never sell or share it.

Next

Read next

Your phone solves a calculus problem to find you

Your phone turns four satellite signals into a blue dot, using Newton's method and a correction for relativity.

Read it →

Advertisement

MasterMathMentor.com

Free course material for high-school math teachers.

Visit MasterMathMentor →