About computing integral integrate(exp(-x^k),x,0,1)



I am aware that this problem can be done by breaking the problem into pieces and doing it that way.  The amazing thing is that abs_integrate.mac and pw.mac can usually do it without all of this extra work.  You generally only have to call integrate once.  Except that in this case both packages get the wrong answer.  I think the reason is that the gamma_incomplete() function is evaluated with a negative argument in some place where it does not cancel out (but I am not sure of that.)  

BTW I am using the new defint.lisp from git, not the one that ships with Maxima 5.25.1.  I should have mentioned that.  It does not matter in this case which defint.lisp you use.

Rich


From: Aleksas Domarkas 
Sent: Monday, January 09, 2012 5:49 AM
To: maxima 
Subject: About computing integral integrate(exp(-x^k),x,0,1)


Sorry, in previous message was formula for integrate(exp(x^k),x,0,1)
For integrate(exp(-x^k),x,0,1) formula is more simpler:

integrate(exp(-x^k),x,0,1)=(gamma(1/k)-gamma_incomplete(1/k,1))/k,

where k is natural number.

Proof.
(%i1) S:'integrate(exp(-x^k),x,0,1);
(%o1) integrate(%e^(-x^k),x,0,1)
(%i2) assume(k>0)$ declare(k,integer)$
(%i4) changevar(S, y=x^k, y, x);
(%o4) integrate(%e^(-y)/y^((k-1)/k),y,0,1)/k
(%i5) ev(%, nouns),factor;
(%o5) -(gamma_incomplete(1/k,1)-gamma(1/k))/k
(%i6) subst(-1=polarform(-1),%),ratsimp;
(%o6) -(gamma_incomplete(1/k,1)-gamma(1/k))/k
q. e. d.

(%i7) define(F(k),%);
(%o7) F(k):=-(gamma_incomplete(1/k,1)-gamma(1/k))/k

For example, we compute integral, if k=3 or k=4.
(%i8) F(3);
(%o8) -(gamma_incomplete(1/3,1)-gamma(1/3))/3
(%i9) float(%), numer;
(%o9) 0.807511182139671
(%i10) /* test*/
first(quad_qags(exp(-x^3),x,0,1));
(%o10) 0.807511182139671

(%i11) F(4);
(%o11) -(gamma_incomplete(1/4,1)-gamma(1/4))/4
(%i12) float(%), numer;
(%o12) 0.844838594757102
(%i13) /* test*/
first(quad_qags(exp(-x^4),x,0,1));
(%o13) 0.844838594757102

Aleksas D.



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