new defint.lisp and radexpand:false?



  About integrate(exp(x^n),x,a,b).

 A.Domarkas
 We discuss problems from
http://www.math.utexas.edu/pipermail/maxima/2012/027403.html

 Theorem. For any real n>0, a>=0, b>0
integrate(exp(x^n),x,a,b)=((gamma_incomplete(1/n,-a^n)-gamma_incomplete(1/n,-b^n))*%e^(-(%i*%pi)/n))/n

 Proof.
(%i1) S:'integrate(exp(x^n),x)$
(%i2) assume(x>0,y>0,n>0)$
(%i3) changevar(S, x=y^(1/n), y, x);
(%o3) integrate(%e^y/y^((n-1)/n),y)/n
(%i4) ev(%, nouns);
(%o4) -gamma_incomplete(1/n,-y)/(n*(-1)^(1/n))
 By Newton-Leibniz formula S  is equal
(%i5) ev(%,y=b^n)-ev(%,y=a^n)$
(%i6) subst(-1=polarform(-1),%)$
(%i7) define(F(n,a,b),factor(%));
(%o7)
F(n,a,b):=-((gamma_incomplete(1/n,-b^n)-gamma_incomplete(1/n,-a^n))*%e^(-(%i*%pi)/n))/n
 q.e.d.

 Example 1
We compute integrate(exp(x^5),x,1,2). Exact form of solution is
(%i8) F(5,1,2);
(%o8)
-(%e^(-(%i*%pi)/5)*(gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1)))/5
(%i9) float(rectform(float(%)));
(%o9) 1.057112842764948*10^12-9.765625*10^-5*%i
(%i10) realpart(%);
(%o10) 1.057112842764948*10^12
(%i11) /* test*/
first(quad_qags(exp(x^5),x,1,2));
(%o11) 1.013239489694018*10^12

 Maxima float value
(%i12) float(gamma_incomplete(1/5,-32));
(%o12) -3.106776694934643*10^12*%i-4.276111273844638*10^12
 is is not sufficiently accurate, because
from WolframAlpha or Python mpmath module ( http://code.google.com/p/mpmath/
)
Gamma(1/5,-32) ~~ -4.098639833*10^12 - 2.977836145*10^12 I

 Example 2
We compute integrate(exp(x^5),x,-1,-2):
(%i13) S:'integrate(exp(x^5),x,-1,-2)$
(%i14) changevar(%, y=-x, y, x);
(%o14) -integrate(%e^(-y^5),y,1,2)
(%i15) ev(%, nouns);
(%o15) -(gamma_incomplete(1/5,1)-gamma_incomplete(1/5,32))/5
(%i16) float(%), numer;
(%o16) -0.0480940747138679
(%i17) /* test*/
first(quad_qags(exp(x^5),x,-1,-2));
(%o17) -0.0480940747138678

 Example 3  integrate(exp(x^3),x,0,1);
(%i18) F(3,0,1);
(%o18) -((1/2-(sqrt(3)*%i)/2)*(gamma_incomplete(1/3,-1)-gamma(1/3)))/3
(%i19) float(%), numer,expand;
(%o19) 1.34190441797742-1.4802973661668753*10^-16*%i
(%i20) /* test*/
first(quad_qags(exp(x^3),x,0,1));
(%o20) 1.34190441797742

  Example 4 integrate(exp(x^(3.5)),x,0,1);
(%i21) F(3.5,0,1);
(%o21)
-0.285714285714286*(-3.564215493727561*%i-2.84236700849009)*%e^(-0.285714285714286*%i*%pi)
(%i22) float(%), numer,expand;
(%o22) 1.302515064637093-1.2688263138573217*10^-16*%i
(%i23) F(7/2,0,1);
(%o23) -(2*%e^(-(2*%i*%pi)/7)*(gamma_incomplete(2/7,-1)-gamma(2/7)))/7
(%i24) float(%), numer,expand;
(%o24) 1.302515064637093-1.2688263138573217*10^-16*%i
(%i25) /* test*/
first(quad_qags(exp(x^(7/2)),x,0,1));
(%o25) 1.302515064637389

 Example 5 integrate(exp(x^4,x,0,1);
(%i26) F(4,0,1);
(%o26) -((1/sqrt(2)-%i/sqrt(2))*(gamma_incomplete(1/4,-1)-gamma(1/4)))/4
(%i27) float(%), numer,expand;
(%o27) 1.271287104904147
(%i28) /* test*/
first(quad_qags(exp(x^4),x,0,1));
(%o28) 1.271287104904147
(%i29) build_info()$

Maxima version: 5.25.1
Maxima build date: 9:23 9/6/2011
Host type: i686-pc-mingw32
Lisp implementation type: Clozure Common Lisp
Lisp implementation version: Version 1.7-r14925M  (WindowsX8632)

 Aleksas D.