Question: Bug: Definite integral of positive function is negative

Let:

f:=x->1/sqrt(2*Pi)*exp(-x^2/2);

I.e. f is a standard Gaussian PDF.

Then (in Maple 2016.1):

Int(convert(f(x)*f(y)*x*x*abs(x+y),piecewise,x),x=-infinity..infinity,y=-infinity..infinity):
evalf(%);

Returns:

1.692568751

However (again in Maple 2016.1):

int(convert(f(x)*f(y)*x*x*abs(x+y),piecewise,x),x=-infinity..infinity,y=-infinity..infinity):
evalf(%);

Returns:

-0.5641895835

This is clearly incorrect, as the integral of a positive function must be positive.

This also seems to be a problem in which ever version of Maple is used behind the scenes on this forum.

int(convert(1/sqrt(2*Pi)*exp(-x^2/2)*1/sqrt(2*Pi)*exp(-y^2/2)*x*x*abs(x+y),piecewise,x),x=-infinity..infinity,y=-infinity..infinity)

gives:

int(convert(1/sqrt(2*Pi)*exp(-x^2/2)*1/sqrt(2*Pi)*exp(-y^2/2)*x*x*abs(x+y),piecewise,x),x=-infinity..infinity,y=-infinity..infinity)

Please Wait...