Integration - Maxima and Mathematica give different result



As to the first question concerning the factor of 2, I suspect it has to do
with this:

V(s):=integrate(l0(s,p)*W(p),p,minf,inf);

vs.

V[s_] := Integrate[I0[s, p]*W[p], {p, 0, \[Infinity]}

The integration limits are not the same.

Incidentally, it appears that neither Maxima nor Maple can evaluate the U(s)
integral if V(s) is defined using the limits 0..infinity, and having tried
some numerical examples, I am actually wondering if the Mathematica result
is really correct. Perhaps someone with more time on their hands can check.

By the way, it really isn't necessary to use function definitions for this
example in Maxima (unless the functional form is needed for some other
reason). The following input would also work just fine:

assume(omega>0);
assume(c>0);
assume(sigma>0);
assume(k>0);
W:2*k*cos(omega*(p)/c);
l0:q/(sigma*sqrt(2*%pi))*exp(-(s-p)^2/(2*sigma^2));
l1:q/(sigma*sqrt(2*%pi))*exp(-(s)^2/(2*sigma^2));
V:integrate(l0*W,p,minf,inf);
V;
U:integrate(V*l1,s,minf,inf);
U;

I also note that as posted originally
(U(s):=integrate(V(s)*l1(s),s,minf,inf);), the U(s) form is rather
misleading since the same symbol (s) is used as a function argument and also
as the dummy integration variable.


Viktor



-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of Rupert Swarbrick
Sent: Saturday, February 09, 2013 4:51 PM
To: maxima at math.utexas.edu
Subject: Re: [Maxima] Integration - Maxima and Mathematica give different
result

Francois Lemery <francois.lemery at gmail.com> writes:
> Dear Maximaticians,
> I am confused why Maxima and Mathematica give different answers for the
> following integration by a factor of 2.

I can't answer the question of the factor of 2 off-hand...

<snip>

> /*  Output gives:
> (2*%pi*k*q^2*%e^(-(omega^2*sigma^2)/c^2))/pi
> **Also, why doesn't maxima remove the pi/pi in this last expression? Even
> after ratsimp??
> */

... but I can answer this one! In Maxima, 3.14159... is called
%pi. "pi" is just some other variable.

Rupert