Handle (diff '(expt x x) x) correctly