Peaks and valleys sit where the tangent goes flat — where f′(x)=0. The second derivative then settles the verdict: cup-down is a max, cup-up is a min. Drag along and see.