Yes, unfortunately SymPy currently does not do so well with integrals
of absolute values.
Am Sonntag, 24. Juni 2012 07:10:05 UTC+2 schrieb Aaron Meurer:Yes, unfortunately SymPy currently does not do so well with integrals
of absolute values.Actually you can work around this limitation by using piecewise functions:In [12]: myabs = lambda x: Piecewise((x, x>=0), (-x, x<0))In [13]: integrate( (t1*t2*t3)**beta * myabs((t1-t2)*(t1-t3)*(t2-t3)),(t1,0,1),(t2,0,1),(t3,0,1)).doit()Out[13]: 0
> Actually you can work around this limitation by using piecewise functions:
>
> In [12]: myabs = lambda x: Piecewise((x, x>=0), (-x, x<0))
>
> In [13]: integrate( (t1*t2*t3)**beta * myabs((t1-t2)*(t1-t3)*(t2-t3)),
> (t1,0,1),(t2,0,1),(t3,0,1)).doit()
> Out[13]: 0
But that answer 0 is wrong!
> You are right, it should not be 0, this is a bug. Do you know the correct
> value?
>
Yes. This is a special case of the so-called Selberg integral (named
for Atle Selberg) , see
http://en.wikipedia.org/wiki/Selberg_integral
The special case above has the value: (G is the gamma function)
S_3(beta+1,1,gamma=1/2) = \prod_{j=1}^3 \frac{ G(beta+1+(j-1)gamma)
G(1+(j-1)gamma) G(1+j gamma) }
{ G(beta+2+(3+j-2)gamma) G(1+gamma) }