The Maths You Actually NeedLesson 22 of 76

Module 3 · Change, slopes and the walk downhill

The chain rule, which is the whole trick

In this lesson

  • 8 min read
  • 8 reading sections
  • Knowledge check
  • Lesson 4 of 9 in this chapter

This chapter’s goalCompute a partial derivative and a chain-rule derivative by hand, trace a gradient backwards through a two-layer network and say where the memory goes, and diagnose from a loss curve and a gradient-norm plot whether the learning rate, the curvature or a vanishing gradient is the cause.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 9Free · no account needed
Lesson steps

Rates multiply

If a car’s fuel use depends on speed, and speed depends on the accelerator position, how does fuel use depend on the accelerator? Multiply the two rates. That is the chain rule, and it is the only calculus fact you have to internalise for machine learning.

Formally, if y = f(u) and u = g(x):

Text
dy/dx = (dy/du) * (du/dx)

Worked. Let y = (3x + 1)^2. Set u = 3x + 1, so y = u^2.

Text
dy/du = 2u = 2(3x + 1)
du/dx = 3
dy/dx = 2(3x + 1) * 3 = 6(3x + 1) = 18x + 6

Check it by expanding first: y = 9x² + 6x + 1, derivative 18x + 6. Same answer. The chain rule saved you the expansion, and in a network the expansion is not available at any price.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Stuck on something?Ask Funke, your AI tutor

How to cite: Addaly (2026) ‘The chain rule, which is the whole trick’, in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/the-chain-rule (Accessed: 29 November 2026).