Three ways to get a derivative, and why two of them lose
| Approach | Input | Failure mode |
|---|---|---|
| Symbolic | a closed-form expression | expression swell: the derivative formula grows far larger than the function, and there is no formula at all for a program with loops |
| Numerical | as a black box | about half your digits, and evaluations for a gradient in variables |
| Automatic | the program that computes | exact to rounding, at a small constant times the cost of one evaluation |
Symbolic differentiation is what a computer algebra system does, and it is genuinely useful right up to the point where the function is 400 lines of Python with a for loop in it. Numerical differencing, from the first lesson, survives that but cannot pay the per-parameter cost.
Automatic differentiation is the third option, and its trick is to refuse to work with formulas at all.

