ConceptOptimization and trade-offs
At a smooth interior maximum or minimum, the rate of change of a function must be exactly zero, because an instant before it was rising or falling and an instant after it reverses, so setting the derivative to zero and checking which case you have is the systematic way to find the best point under a real trade-off.