Working with the intermediate value theorem