The real art to programming is learning how to decompose a large task into smaller, more manageable ones.
For implementing Newton's Method for finding roots, I decomposed the problem into 3 functions; here are the comments for them.
;; (estimate-slope f x) ;; Given a function f:R->R, and a real number x, ;; find (roughly) the slope of f at x. ;; (define estimate-slope ;... ;; (crosses-at x0 y0 m) ;; given a point (x0,y0) and a slope m, ;; calculate where the line so determined ;; crosses the x-axis. ;; ;; This code assumes m is not zero! ;; (define crosses-x-at ;... ;; (newton f x0) ;; Starting at x0, iterate f by newton's method ;; until we are close to root. ;; (define newton ;...My entire solution and test cases are here.