intermediate value theorem vs first derivative test