Integration - Maxima and Mathematica give different result
Subject: Integration - Maxima and Mathematica give different result
From: Robert Dodier
Date: Sun, 10 Feb 2013 06:31:04 +0000 (UTC)
On 2013-02-09, Francois Lemery <francois.lemery at gmail.com> wrote:
> I am confused why Maxima and Mathematica give different answers for the
> following integration by a factor of 2.
I dunno -- looks like Maxima's symbolic answer is correct, to judge by
some arbitrarily-chosen numerical values. (One set of assignments is
shown below, but I tried some others and they also matched.)
I guess it wouldn't be too hard to work out the result by hand, but I am
too lazy these days ....
best,
Robert Dodier
PS.
(%i3) assume(omega > 0)
(%i4) assume(c > 0)
(%i5) assume(sigma > 0)
(%i6) assume(k > 0)
(%i7) W(p):=2*k*cos(omega*p/c)
(%i8) l0(s,p):=q*exp((-(s-p)^2)/(2*sigma^2))/(sigma*sqrt(2*%pi))
(%i9) l1(s):=q*exp((-s^2)/(2*sigma^2))/(sigma*sqrt(2*%pi))
(%i10) V(s):=integrate(l0(s,p)*W(p),p,minf,inf)
(%i11) V(s)
(%o11) 2*k*q*cos(omega*s/c)*%e^-(omega^2*sigma^2/(2*c^2))
(%i12) U(s):=integrate(V(s)*l1(s),s,minf,inf)
(%i13) U(s)
(%o13) 2*k*q^2*%e^-(omega^2*sigma^2/c^2)
(%i14) ev(%,omega = 5/4,c = 1/2,sigma = 3/4,k = 3/2,q = 7/5,numer)
(%o14) .1748077923506134
(%i15)
ev(quad_qagi(quad_qagi(l0(s,p)*W(p),p,minf,inf)[1]*l1(s),s,minf,inf),
omega = 5/4,c = 1/2,sigma = 3/4,k = 3/2,q = 7/5)
(%o15) [.1748077923506146,2.092806681030426e-10,390,0]