How to find inflection points