The product rule and the chain rule
Why this matters
The rules of lesson 73 handle sums of powers. Real formulas are built differently: one function inside another, like (3x + 1)², or two multiplied together. A neural network is the extreme case, a long chain of small steps, each feeding the next. The chain rule says how to get the slope of the whole chain from the slopes of its links: multiply them. That one sentence is backpropagation, the algorithm that trains every neural network, and by the end of this lesson you'll use it to find how a neuron's loss changes with its weight, one link at a time.
- Differentiate a product with the product rule: (fg)′ = f′g + fg′
- Differentiate a chain of functions by multiplying the local slopes: dy/dx = dy/du × du/dx
- Compute a chain forward, then its slope backward as a product, and check it numerically
- Find dL/dw for one neuron, x → z → a → L, as a product of three local slopes, and read every link's slope from PyTorch
The math: products and chains
Purpose. Slopes of functions built from other functions.
The product rule. When two functions are multiplied, each takes a turn changing while the other holds:
In plain words: the slope of the first times the second, plus the first times the slope of the second.
For x²·(3x + 1) at x = 2: 2x·(3x + 1) + x²·3 = 4 × 7 + 4 × 3 = 40. A named mistake is multiplying the two slopes, 2x × 3 = 12, which is wrong.