Examples for redctdemonstrates an implementation of the algorithm based on generalized Hermite reductionrestart;libname:=".",libname: # Mgfun is neededread "redct.mpl";The syntax is
redct(Int(...,var=...),[list of variables with their natures])the output is list of telescopers for the integrand wrt these variables.This list forms a Gr\303\266bner basis of the telescoping ideal for tdeg.Example from our article:F:=exp(-p*x)*ChebyshevT(n,x)/sqrt(1-x^2);redct(Int(F,x=-1..1),[n::shift,p::diff]);Several of the operators computed in this session are big. Configure the interface so that it does not display too much:interface(elisiontermsafter=2,elisiontermsbefore=2,elisiontermsthreshold=5,termelisionthreshold=10,elisiondigitsafter=3,elisiondigitsbefore=3,elisiondigitsthreshold=14):For bigger examples, we use the following piece of code to display input, output and time:bigredct:=proc(f,vars) local res, tt;
print(f);
tt:=time(assign('res'=redct(args)));
if nops(res)=1 then res:=op(res) fi;
print(res);
printf("time = %g sec.\134n",tt);NULL
end:Examples from C. Koutschan's Examples11.nbEasy onesst:=time():redct(Int((LegendreP(2*k+1,x)/x)^2,x=-1..1),[k::shift]);redct(Int((1-m*u^2)^(j-1/2)/sqrt(1-u^2),u=0..1),[j::shift]);redct(Int(arccos(x/sqrt((a+b)*x-a*b)),x=a..b),[a::diff,b::diff]);redct(Int(u^(2*m)/sqrt(1-u^2),u=0..1),[m::shift]);redct(Int(1/(x^4+2*a*x^2+1)^(m+1),x=0..infinity),[a::diff,m::shift]);redct(Int(LegendreP(2*n,u)/sqrt(1-u^2),u=-1..1),[n::shift]);redct(Int(sin(m*x)*sin(n*x),x=0..2*Pi),[n::diff,m::diff]);redct(Int(exp(-u*(a+1))*log(u),u=0..infinity),[a::diff]);redct(subs(s=4,Int((x^2/(x^4+2*a*x^2+1))^r*(x^2+1)/x^2/(x^s+1),x=0..infinity)),[r::shift,a::diff]);redct(Int(arcsinh(x)*exp(-z*x)/sqrt(x^2+1),x=0..infinity),[z::diff]);redct(Int(arcsinh(x)^2*exp(-z*x)*z/2,x=0..infinity),[z::diff]);redct(Int(x*arcsinh(x)*exp(-z*x)/sqrt(x^2+1),x=0..infinity),[z::diff]);redct(Int(arcsinh(x)/(1+x^2)^(n+1),x=0..infinity),[n::shift]);redct(Int(x^n*BesselJ(n,x)*LommelS2(-1,0,x),x=0..infinity),[n::shift]);redct(Int((1+x*t+t^2)^(-2),t),[x::diff]);redct(Int(1/(1+x^2)^n,x),[n::shift]);redct(Int(x^(mu-1)*exp(-g*x-b*x^2)*sin(a*x),x=0..infinity),[mu::shift,g::diff,b::diff,a::diff]);redct(Int(arctan(p*x)/(1+p^2*x),x=0..1),[p::diff]);redct(Int(BesselJ(m,a*x)*BesselJ(n,b*x),x=0..infinity),[n::shift,m::shift,a::diff,b::diff]);redct(Int(1/sqrt(x^2+a^2)*log((sqrt(x^2+a^2)+x)/(sqrt(x^2+a^2)-x))*BesselJ(0,b*x),x=0..infinity),[a::diff,b::diff]);redct(Int((1-x^2)^(nu-1/2)*GegenbauerC(m,nu,x)*GegenbauerC(n,nu,x),x=-1..1),[n::shift,m::shift,nu::shift]);redct(Int((x*(2*a-x))^(nu-1/2)*GegenbauerC(n,nu,x/a-1)*exp(-b*x),x=0..2*a),[n::shift,nu::shift,a::diff,b::diff]);redct(Int(ChebyshevT(n,1-x^2*y)/sqrt(1-x^2),x=-1..1),[y::diff,n::shift]);redct(Int(x^(r-1)*(1-x)^(s-1)*hypergeom([a,b],[c],x),x=0..1),[r::shift,s::shift,a::shift,b::shift,c::shift]);redct(Int((1-t^2)^(n-1/2)*cos(z*t)*(z/2)^n/GAMMA(n+1/2)/GAMMA(1/2),t=-1..1),[z::diff]);redct(Int(t^(-n-1)*exp(t-z^2/4/t),t=c-I*infinity..c+I*infinity),[z::diff,n::shift]);redct(Int(sin(z*t)*(1-t^2)^(n+1/2),t=0..1),[n::shift,z::diff]);redct(Int(exp(-z*t)*(1-t^2)^(n+1/2),t=0..1),[n::shift,z::diff]);redct(Int(BesselJ(n,b*t)*exp(-p^2*t^2)*t^(n+1),t=0..infinity),[n::shift,b::diff,p::diff]);redct(Int(t^n*BesselY(n,a*t)/(t^2+k^2),t=0..infinity),[n::shift, a::diff, k::diff]);
redct(Int(exp(-p^2*t^2)*BesselJ(0,a*t)*BesselY(0,a*t),t=0..infinity),[a::diff,p::diff]);
redct(Int(z^(n+1)*BesselI(n,z),z),[n::shift]);
redct(Int(x^(a-1)*(1-x)^(b-1),x=0..1),[a::shift,b::shift]);
redct(Int(exp(-a*t)*StruveH(0,t),t=0..infinity),[a::diff]);
redct(Int(AiryAi(2^(2/3)*(u^2+x)),u=0..infinity),[x::diff]);Total time for this section:time()-st;Longer onesst:=time():redct(Int(2*BesselJ(m+n,2*z*t)*ChebyshevT(m-n,t)/sqrt(1-t^2),t=0..1),[m::shift,n::shift,z::diff]);time taken:time()-st;Problematic onesInt(GegenbauerC(l,lambda,x)*GegenbauerC(m,lambda,x)*GegenbauerC(n,lambda,x)*(1-x^2)^(lambda-1/2),x=-1..1),[n::shift,m::shift,l::shift];timelimit(3600,redct(%));andInt(x*BesselJ(1,a*x)*BesselI(1,a*x)*BesselY(0,x)*BesselK(0,x),x=0..infinity);timelimit(3600,redct(%,[a::diff]));take way too long with this version of the code. st:=time():Currently, dedicated code is necessary for:Int((c+I*u*(-c^2+1)^(1/2))^n/(-u^2+1)^(1/2),u=0..Pi);we can reencode the input as a solution of a linear system and integrate:lfs := LFSol({(-c^2*n*u^2+c^2*n+n*u^2-u^2-n)*_f(c, n, u)+(c^3*u^2-c^3-c*u^2+c)*(diff(_f(c, n, u), c))+(-u^3+u)*(diff(_f(c, n, u), u)), (-c^2*n*u^4+c^2*u^4+n*u^4-c^2*u^2-u^4+c^2*n-n*u^2)*_f(c, n, u)+(c*n*u^2-c*n)*_f(c, n+1, u)+(c^2*u^5-2*c^2*u^3-u^5+c^2*u+u^3)*(diff(_f(c, n, u), u)), (c^2*n^2*u^4-3*c^2*n*u^4-2*c^2*n^2*u^2+2*c^2*u^4-n^2*u^4+4*c^2*n*u^2+3*n*u^4+c^2*n^2-3*c^2*u^2+2*n^2*u^2-2*u^4-c^2*n-4*n*u^2+c^2-n^2+3*u^2+n)*_f(c, n, u)+(-2*c^2*n*u^5+4*c^2*u^5+4*c^2*n*u^3+2*n*u^5-8*c^2*u^3-4*u^5-2*c^2*n*u-4*n*u^3+4*c^2*u+6*u^3+2*n*u-2*u)*(diff(_f(c, n, u), u))+(c^2*u^6-3*c^2*u^4-u^6+3*c^2*u^2+2*u^4-c^2-u^2)*(diff(_f(c, n, u), u, u))}):redct(Int(lfs, u = 0..Pi), [n::shift, c::diff]);Int(exp(x)*x^(-a/2)*exp(-t)*t^(n+a/2)*BesselJ(a,2*sqrt(t*x))/n!,t=0..infinity);is not recognized as D-finite by Mgfun. Till this is fixed, one can simply change a into 2a :redct(subs(a=2*a,Int(exp(x)*x^(-a/2)*exp(-t)*t^(n+a/2)*BesselJ(a,2*sqrt(t*x))/n!,t=0..infinity)),[n::shift,a::shift,x::diff]);time()-st;Bivariate rational integrandsst:=time():for d to 16 do
bigredct(Int(subs([x=y,y=x/y],1/(1-x-y-x*y*(1-x^d)))/y,y),[x::diff]);
od;