I don't do much manual derivative, but are you sure the results should be T.exp(x)? I would have expected x, as T.exp(x) is considered constant.