Implemented Newton's Method to approximate roots of functions.