Hi:

import sympy
x=sympy.symbols('x',real=True)
sympy.integrate(sympy.Heaviside(x-1)*(x-1)+1,(x,0,2))

the output is 2, which is wrong, the correct answer is 5/2

I try the following Mathematica code:

Integrate[HeavisideTheta[x - 1]*(x - 1) + 1, {x, 0, 2}] which gives me 5/2

also the following piecewise function:

sympy.integrate(sympy.Piecewise((1,x<1),(x,x>1)),(x,0,2)) which gives me 
the correct answer

So I want to ask whether it is a bug in Heaviside function or there are 
some special explanations in sympy?

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/dd352401-c01a-4b5d-b199-d7cff5552ecb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to