Implementation of the first heuristic

Replaced y with f(x)

Made changes

Added tests and function to check infinitesimals

Corrected doctest failure

Modified tests and other minor changes

minor changes in docstring