Problem PS.2.2.1: Derivative Rules
(plus IF (deriv ?v ?dv) (deriv ?w ?dw) THEN (deriv (plus ?v ?w) (plus ?dv ?dw))) (times IF (deriv ?v ?dv) (deriv ?w ?dw) THEN (deriv (times ?v ?w) (plus (times ?v ?dw) (times ?dv ?w))))
We will use an auxiliary rule that can tell us if an expression can be treated as a constant, that is, when it does not contain x.
(aux IF AND-IF (not (contains? 'x '?x)) THEN (constant ?x))
Your job is to finish up this system of rules so that we can differentiate expression involving the sum and product of terms (some of which involve the variable x). For example, we would do
(backchain '(deriv (plus x (times x x)) ?ans))
Below is an applet that flashes matching parens and does Scheme indenting when you type Tab.