tholden

20 Reputation

3 Badges

4 years, 296 days

MaplePrimes Activity


These are questions asked by tholden

Suppose I have one or more equations in the variables x[1] , ..., x[n], where each equation is a linear combination of rational functions in x[1] , ..., x[n]. For example, one equation might be:

(a*x[1]+b*x[2])/x[3] + c * x[1]^2 / ( d + e*x[2]) = f

Any such equation can be turned into a polynomial by multiplying both sides by the products of all the denominators. In the example, this would be x[3]( e*x[2] + d ).

My question is whether there is a Maple command to do this automatically? This would be helpful as I have a large number of equations.

See the below. The two answers should be identical, but they are not.

Input:


Output:


 

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)

Page 1 of 1