<cl> (prologx '$x '(differentiate (^ x 2) x $x))
(prologx '$x '(differentiate (^ x 2) x $x))

Call: (DIFFERENTIATE (^ X 2) X $X)
 | Call: (DIFF (^ X 2) X $446)
 |  | Call: (NUMBERP 2)
 |  | Exit: (NUMBERP 2)
 |  | Call: (DIFF X X $447)
 |  | Exit: (DIFF X X 1)
 | Exit: (DIFF (^ X 2) X (* 1 (* 2 (^ X (- 2 1)))))
 | Call: (SIMPLIFY (* 1 (* 2 (^ X (- 2 1)))) $X)
 |  | Call: (REWRITE (* 1 (* 2 (^ X (- 2 1)))) $448)
 |  | Exit: (REWRITE (* 1 (* 2 (^ X (- 2 1)))) (* 2 (^ X (- 2 1))))
 |  | Call: (SIMPLIFY (* 2 (^ X (- 2 1))) $X)
 |  |  | Call: (SIMPLIFY 2 2)
 |  |  |  | Call: (PRIMITIVE 2)
 |  |  |  |  | Call: (NUMBERP 2)
 |  |  |  |  | Exit: (NUMBERP 2)
 |  |  |  | Exit: (PRIMITIVE 2)
 |  |  | Exit: (SIMPLIFY 2 2)
 |  |  | Call: (SIMPLIFY (^ X (- 2 1)) $464)
 |  |  |  | Call: (SIMPLIFY X X)
 |  |  |  |  | Call: (PRIMITIVE X)
 |  |  |  |  |  | Call: (VARIABLE X)
 |  |  |  |  |  | Exit: (VARIABLE X)
 |  |  |  |  | Exit: (PRIMITIVE X)
 |  |  |  | Exit: (SIMPLIFY X X)
 |  |  |  | Call: (SIMPLIFY (- 2 1) $471)
 |  |  |  |  | Call: (REWRITE (- 2 1) $472)
 |  |  |  |  |  | Call: (NUMBERP 2)
 |  |  |  |  |  | Exit: (NUMBERP 2)
 |  |  |  |  |  | Call: (NUMBERP 1)
 |  |  |  |  |  | Exit: (NUMBERP 1)
 |  |  |  |  |  | Call: (= $472 (- 2 1))
 |  |  |  |  |  |  | Eval: $472
 |  |  |  |  |  |  | Exit: $472
 |  |  |  |  |  |  | Eval: (- 2 1)
 |  |  |  |  |  |  |  | Eval: 2
 |  |  |  |  |  |  |  | Exit: 2
 |  |  |  |  |  |  |  | Eval: 1
 |  |  |  |  |  |  |  | Exit: 1
 |  |  |  |  |  |  | Exit: 1
 |  |  |  |  |  | Exit: (= 1 (- 2 1))
 |  |  |  |  | Exit: (REWRITE (- 2 1) 1)
 |  |  |  |  | Call: (SIMPLIFY 1 $471)
 |  |  |  |  |  | Call: (PRIMITIVE 1)
 |  |  |  |  |  |  | Call: (NUMBERP 1)
 |  |  |  |  |  |  | Exit: (NUMBERP 1)
 |  |  |  |  |  | Exit: (PRIMITIVE 1)
 |  |  |  |  | Exit: (SIMPLIFY 1 1)
 |  |  |  | Exit: (SIMPLIFY (- 2 1) 1)
 |  |  |  | Call: (SIMPLIFY (^ X 1) $464)
 |  |  |  |  | Call: (REWRITE (^ X 1) $474)
 |  |  |  |  | Exit: (REWRITE (^ X 1) X)
 |  |  |  |  | Call: (SIMPLIFY X $464)
 |  |  |  |  |  | Call: (PRIMITIVE X)
 |  |  |  |  |  |  | Call: (VARIABLE X)
 |  |  |  |  |  |  | Exit: (VARIABLE X)
 |  |  |  |  |  | Exit: (PRIMITIVE X)
 |  |  |  |  | Exit: (SIMPLIFY X X)
 |  |  |  | Exit: (SIMPLIFY (^ X 1) X)
 |  |  | Exit: (SIMPLIFY (^ X (- 2 1)) X)
 |  |  | Call: (SIMPLIFY (* 2 X) $X)
 |  |  |  | Call: (SIMPLIFY 2 2)
 |  |  |  |  | Call: (PRIMITIVE 2)
 |  |  |  |  |  | Call: (NUMBERP 2)
 |  |  |  |  |  | Exit: (NUMBERP 2)
 |  |  |  |  | Exit: (PRIMITIVE 2)
 |  |  |  | Exit: (SIMPLIFY 2 2)
 |  |  |  | Call: (SIMPLIFY X X)
 |  |  |  |  | Call: (PRIMITIVE X)
 |  |  |  |  |  | Call: (VARIABLE X)
 |  |  |  |  |  | Exit: (VARIABLE X)
 |  |  |  |  | Exit: (PRIMITIVE X)
 |  |  |  | Exit: (SIMPLIFY X X)
 |  |  | Exit: (SIMPLIFY (* 2 X) (* 2 X))
 |  | Exit: (SIMPLIFY (* 2 (^ X (- 2 1))) (* 2 X))
 | Exit: (SIMPLIFY (* 1 (* 2 (^ X (- 2 1)))) (* 2 X))
Exit: (DIFFERENTIATE (^ X 2) X (* 2 X))
(* 2 X) 
