# [sympy] does this Piecewise integration look right?

```I'm also wondering if the following behavior is right:

```
>>> Piecewise((1, x < 1), (2, Eq(x, 3) & (y < x)), (3, True)).integrate((x,
0, 3))
7
>>> Piecewise((1, x < 1), (2, y < 3), (3, True)).integrate((x, 0, 3))
Piecewise((5, (y >= -oo) & (y < 3)), (7, True))
``````
```
In the first case, the 2nd condition depends on x and y whereas in the 2nd
case it only
depends on y...and in the first case since it depends on x and x's range
for the 2nd expression
is from 3 to 3 (zero width) it can't contribute to the integration. So is
it right to ignore the value
of y?

And what if there were a DiracDelta function there instead of 2 and the
of 3...then there *would* be a contribution...but this is presently ignored
by the current routine:

```
>>> integrate( Piecewise((DiracDelta(x),x<2),(0,True)), (x,-1,1))
1
>>> integrate( Piecewise((DiracDelta(x),Eq(x,0)),(0,True)), (x,-1,1))
0
```

/c

--
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