Basic differentiator

Show how to extend the basic differentiator to handle more kinds of expressions. For instance, implement the differentiation rule

2.56

by adding a new clause to the deriv program and defining appropriate procedures exponentiation?, base, exponent, and make-exponentiation. (You may use the symbol ** to denote exponentiation.) Build in the rules that anything raised to the power 0 is 1 and anything raised to the power 1 is the thing itself.


There are no comments yet.

Authentication required

You must log in to post a comment.

Login
(check-equal? (exponentiation? '(** x 3)) #t)
(check-equal? (exponentiation? '(+ x 3)) #f)
(check-equal? (make-exponentiation 'x 2) '(** x 2))
(check-equal? (exponent '(** x 3)) 3)
(check-equal? (base '(** (+ x 1) 3)) '(+ x 1))
(check-equal? (deriv '(** x 3) 'x) '(* 3 (** x 2)))
(check-equal? (make-exponentiation 'x 0) 1)
(check-equal? (make-exponentiation '(+ (/ x y) 4) 1) '(+ (/ x y) 4))