Using the recent version of sympy (0.7.6) I get the following bad result when determining the integral of a function with support [0,y):
from sympy import *
a,b,c,x,z = symbols("a,b,c,x,z",real = True)
y = Symbol("y",real=True,positive=True)
inner = Piecewise((0,(x>=y)|(x<0)|(b>c)),(a,True))
I = Integral(inner,(x,0,z))
Eq(I,I.doit())
This is incorrect as the actual result should have the last two cases swapped. This can be confirmed by checking the derivative:
Derivative(I.doit(),z).doit().simplify().subs(z,x)
which reduces to 0 everywhere.
Interestingly, when dropping the condition (b>c)
by substituting inner = Piecewise((0,(x>=y)|(x<0)),(a,True))
I get a TypeError:
TypeError: cannot determine truth value of
-oo < y
Am I using the library incorrectly or is this actually a serious sympy bug?