I have a complicated sympy expression and I want to simplify it. However, I get a TypeError. The following is a shortened version of my expression but reproduces the error:
from sympy import *
x = Symbol('x')
y = Symbol('y')
ux = Function('ux')(x,y)
uy = Function('uy')(x,y)
a = ((Derivative(ux, x)*Derivative(uy, y)+ 1.0*Derivative(ux, x) - Derivative(ux, y)*Derivative(uy, x) + 1.0*Derivative(uy, y) + 1.0)
*(1.0*Derivative(ux, x)*Derivative(uy, y) + 1.0*Derivative(ux, x) - 1.0*Derivative(ux, y)*Derivative(uy, x) + 1.0*Derivative(uy, y) + 1.0)) / (Derivative(uy, y) + 1.0)
b = simplify(a)
Can anybody explain what is the problem?
Remark: The multiplication with 1.0 can be removed (and then it works without any error), however the expression is automatically created and at the moment I dont see how to do this removal.