At the very top of a hill the ground is level, so look for the best where the slope is zero.
If you're still going uphill you aren't at the top yet, so at a maximum or minimum the derivative has to be zero. That one observation turns "find the best box" into "solve ", and it scales up. In several variables every partial derivative is zero; with a constraint the gradients line up; and in machine learning, when the equation is too big to solve, you keep walking downhill until the slope runs out.
8 lessons across 5 topics, in the order you'd meet them.