finding stationary points without differentiation