Gausian bug maybe?



Still invalid with kill all and no maxima-init file.  Can anyone else reproduce this?  I hope it is not something on my 
side.

(%i1) kill(all);
(eq0) done
(%i1) assume_pos:true;
(eq1) true
(%i2) (declare(n,integer),assume(sigma>0,equal(n-1,0)));
(eq2) [sigma>0,equal(n,1)]
(%i3) f(x):=(sqrt(2)/(2*sqrt(%pi)*sqrt(sigma)))*exp(-(x^2/(2*sigma)));
(eq3) f(x):=sqrt(2)/(2*sqrt(%pi)*sqrt(sigma))*exp(-x^2/(2*sigma))
(%i4) integrate(f(x),x,minf,inf);
(eq4) 1
(%i5) integrate(x^2*f(x),x,minf,inf)-(integrate(x*f(x),x,minf,inf))^2;
(eq5) sigma
(%i6) integrate(x*f(a*x-b^2),x,minf,inf);
(eq6) b^2/a^2
(%i7) limit(integrate((a*x^3+b*x^2+c*x+d)*f(x^n),x,minf,inf),sigma,0);
limit(integrate((a*x^3+b*x^2+c*x+d)*f(  x  ),x,minf,inf),sigma,0);
(eq7) 0
(eq8) d



----- Original Message ----- 
From: "Richard Hennessy" <rvh2007 at comcast.net>
To: "Robert Dodier" <robert.dodier at gmail.com>
Cc: "Maxima List" <maxima at math.utexas.edu>
Sent: Thursday, October 09, 2008 8:33 PM
Subject: Re: [Maxima] Gausian bug maybe?


I found one.  An gaussian incorrect answer.

Try

(%i1) assume_pos:true;
(%o1) true
(%i2) (declare(n,integer),assume(sigma>0,n>0));
(%o2) [sigma>0,n>0]
(%i3) f(x):=(sqrt(2)/(2*sqrt(%pi)*sqrt(sigma)))*exp(-(x^2/(2*sigma)));
(%o3) f(x):=sqrt(2)/(2*sqrt(%pi)*sqrt(sigma))*exp(-x^2/(2*sigma))

(%i8) limit(integrate((a*x^3+b*x^2+c*x+d)*f(x^n),x,minf,inf), sigma, 0);
Is  n-1  positive, negative, or zero?zero;
(%o8) 0

The correct answer is d which can be shown as follows.

(%i10) limit(integrate((a*x^3+b*x^2+c*x+d)*f(x),x,minf,inf),sigma,0);
(%o10) d

There is no difference between these two expressions when n = 1, they should have the same answer.

Rich


----- Original Message ----- 
From: "Richard Hennessy" <rvh2007 at comcast.net>
To: "Robert Dodier" <robert.dodier at gmail.com>
Cc: "Maxima List" <maxima at math.utexas.edu>
Sent: Thursday, October 09, 2008 6:53 PM
Subject: Re: [Maxima] Gausian bug maybe?


integrate(expr1*f(expr2),x,minf,inf)


This is just one of many problems with this type of integral.  I don't know how easy it is to fix it because you can get
same situation by choosing many different possible expressions for expr1 and expr2.  Also I think in some cases the
final answer "may" be wrong even if you give consistent answers.  I have encountered "und" sometimes which I think is
the case I tried that was wrong.  I could try to reproduce that one, prove it numerically and post it if I can.

Here is another really bad case (one of many).

(%i1) assume(a>0, b>0,c>0,%sigma>0);
(eq1) [a>0,b>0,c>0,%sigma>0]
(%i2) f(x):=(%e^((-(x)^2)/(4*%sigma^2))/(2^(1/4)*%pi^(1/4)*sqrt(%sigma)))^2;
(eq2) f(x):=(%e^((-x^2)/(4*%sigma^2))/(2^(1/4)*%pi^(1/4)*sqrt(%sigma)))^2
(%i3) limit(integrate((x-5)^5*f(5*x-8), x, minf, inf), %sigma, 0);
(eq3) -1419857/15625
(%i4) integrate(f(x)*x^2, x, minf, inf)-integrate(f(x)*x, x, minf, inf)^2;
(eq4) %sigma^2
(%i5) limit(integrate((x-5)^5*f(5*x^4+x^3), x, minf, inf), %sigma, 0);
Is  yx   positive or negative? p;
Is  log(yx)   negative or zero? p;
Is  log(yx)   negative or zero? p;
Is  log(yx)   negative or zero? n;
Is  32000 * sqrt(2) * %sigma * sqrt(-log(yx)) - 27   positive, negative, or zero? p;
Is  yx   positive or negative? n;
Is  sqrt(log(-yx)^2+%pi^2) + log(-yx)   positive, negative, or zero? z;
Is  sqrt(log(-yx)^2+%pi^2) - log(-yx)   positive, negative, or zero? n;
Is  1728000 * %sigma * log(-yx) * sqrt(log(-yx)^2+%pi^2) + 3456000 * %sigma * log(-yx)^2   positive, negative, or zero?
p;
Is  2097152000000000000 * %sigma^4 * log(-yx)^6 + sqrt(log(-yx)^2+%pi^2) *
(-2097152000000000000*%sigma^4*log(-yx)^5-1492992000000*%sigma^2*log(-yx)^4+4194304000000000000*%pi^2*%sigma^4*log(-yx)^3+6291456000000000000*%pi^4*%sigma^4*log(-yx)+1492992000000*%pi^4*%sigma^2)
+ 1492992000000 * %sigma^2 * log(-yx)^5 +
(531441-3145728000000000000*%pi^2*%sigma^4) * log(-yx)^4 - 5971968000000 * %pi^2 * %sigma^2 * log(-yx)^3 +
(12582912000000000000*%pi^4*%sigma^4+1062882*%pi^2) * log(-yx)^2 + 4478976000000 * %pi^4 * %sigma^2 * log(-yx) +
1048576000000000000 * %pi^6 * %sigma^4 + 531441 * %pi^4
  positive, negative, or zero?


Rich


----- Original Message ----- 
From: "Robert Dodier" <robert.dodier at gmail.com>
To: "Richard Hennessy" <rvh2007 at comcast.net>
Cc: "Maxima List" <maxima at math.utexas.edu>
Sent: Thursday, October 09, 2008 10:43 AM
Subject: Re: [Maxima] Gausian bug maybe?


On 10/9/08, Richard Hennessy <rvh2007 at comcast.net> wrote:

>  I think this is right above but when the exponent is n you get an
>  unending sequence of questions as long as you don't
>  answer no to any of them.

Well, this is a pretty good example. Please make a bug report
if you have the time. I don't know when we'll fix it but let's
not lose track of it. For this particular example it may be relatively
easy to make progress. I'll try to remember to look at it.

Robert Dodier

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima