Accumulate notes from lecture

You will need to rewrite accumulate so that it is an iterative process. Here is code from lecture, including accumulate written as a recursive process, that may be helpful.

(define square (lambda (x) (* x x)))
(define (square x) (* x x))  ; No distinction between this and previous line of code
(define 1+ (lambda (x) (+ x 1)))
(define (identity x) x)      ; Output the same as input

(define (sum term a next b)
  (accumulate + 0 term a next b))

(define (product term a next b)
  (accumulate * 1 term a next b))

(define (accumulate combiner id term a next b)
  (cond ((> a b) id)
        (else (combiner (term a) (accumulate combiner id term (next a) next b)))))

(define (definite-integral f a b)
  (let ((EPSILON 1/100000))
    (* 1. (* EPSILON (accumulate + 0 f a (lambda (x) (+ x EPSILON)) b)))))