Maxima and minima without calculus