Tensor by Tensor

MODULE 01 · LESSON 05

Chain rule

The chain rule joins local slopes across connected calculations.

PLAIN-LANGUAGE INTRODUCTION

The idea

The chain rule joins local slopes across connected calculations.

A worked example

Let u=3x and L=u² at x=2. Then dL/dx = 12×3 = 36.

The input

Connected calculations and their starting value. Here, x=2.

The result

The final change caused by the starting value. Here, dL/dx=36.

Why you use it

Backpropagation uses this rule to find every parameter’s effect on loss.

A limit to remember

Backpropagation does not update parameters. It calculates their gradients.

Check your understanding

  1. First compute forward: u = 3×2 = 6. Then L = 6² = 36.
  2. The local slope from x to u is du/dx = 3.
  3. The local slope from u to L is dL/du = 2u = 12.
  4. Multiply connected slopes: dL/dx = 12×3 = 36. Backpropagation repeats this backward.
  5. Common mistake: adding connected slopes gives 15. The chain rule multiplies them.
Open the detailed notes ↗