Finds roots, extrema and inflection points of a curve