<<RISC`HolonomicFunctions`

HolonomicFunctions Package version 1.7.3 (21-Mar-2017)
written by Christoph Koutschan
Copyright Research Institute for Symbolic Computation (RISC),
Johannes Kepler University, Linz, Austria

TimeBound = 60 * 60 ;

Test[f_,var_,rest_]:=TimeConstrained[Timing[FindCreativeTelescoping[ Annihilator[f,Union[{var},rest]],var, rest]], TimeBound]

Examples from C. Koutschan’s Examples11.nb

I. Easy ones

st = TimeUsed[];

Test[(LegendreP[2k+1,x]/x)^2,Der[x], {S[k]}]

Test[Sqrt[1-m*u^2]^(2j-1)/Sqrt[1-u^2],Der[u],{S[j]}]

Test[ArcCos[x/Sqrt[(a+b)*x-a*b]],Der[x],{Der[a],Der[b]}]

Test[u^(2m)/Sqrt[1-u^2], Der[u], {S[m]}]

Test[1/(x^4+2 a x^2+1)^(m+1),Der[x], {S[m],Der[a]}]

Test[LegendreP[2n,u]/Sqrt[1-u^2], Der[u], {S[n]}]

Test[Sin[m*x]*Sin[n*x],Der[x],{S[m],S[n]}]

Test[Exp[-u(a+1)]*Log[u],Der[a],{Der[u]}]

Victor Moll’s integral: special case s=4.

ff = (x^2/(x^4+2a x^2+1))^r*(x^2+1)/x^2/(x^s+1)/.s->4

Test[ff,Der[x],{Der[a],S[r]}]

Test[ArcSinh[x]/Sqrt[x^2+1]*E^(-z*x),Der[x],{Der[z]}]

Test[z/2*ArcSinh[x]^2*E^(-z*x),Der[x],{Der[z]}]

Test[x*ArcSinh[x]/Sqrt[x^2+1]*E^(-z*x)/2, Der[x],{Der[z]}]

Test[ArcSinh[x]/(1+x^2)^(n+1),Der[x],{S[n]}]

annLommel=ToOrePolynomial[{S[n]-1,Der[x]**(x^2*Der[x]^2+x*Der[x]+x^2)},OreAlgebra[Der[x],S[n]]]

integrand=DFiniteTimes[Annihilator[x^n*BesselJ[n,x],{Der[x],S[n]}],annLommel]

ct = CreativeTelescoping[integrand, Der[x], S[n]]

Test[(1+x t+t^2)^(-2),Der[t],{Der[x]}]

Test[1/(1+x^2)^n, Der[x],{ S[n]}]

Test[x^(m-1)*Exp[-c*x-b*x^2]*Sin[a*x],Der[x], {S[m],Der[a],Der[b], Der[c]}]

Test[ArcTan[p*x]/(1+p^2*x),Der[x],{Der[p]}]

Test[BesselJ[m,a*x]*BesselJ[n,b*x], Der[x], {S[n],S[m],Der[a], Der[b]}]

Test[Log[(Sqrt[x^2+a^2]+x)/(Sqrt[x^2+a^2]-x)]*BesselJ[0,b*x]/Sqrt[x^2+a^2], Der[x], {Der[a],Der[b]}]

Test[(1-x^2)^(nu-1/2)*GegenbauerC[m,nu,x]*GegenbauerC[n,nu,x],Der[x],{S[n],S[m],S[nu]}]

Test[(x(2a-x))^(nu-1/2)*GegenbauerC[n,nu,x/a-1]*E^(-b*x),Der[x], {Der[a],Der[b],S[n],S[nu]}]

Test[ChebyshevT[n,1-x^2 y]/Sqrt[1-x^2], Der[x],{S[n],Der[y]}]

Test[x^(r-1)*(1-x)^(s-1)*Hypergeometric2F1[a,b,c,x], Der[x], {S[a],S[b],S[c],S[r],S[s]}]

Test[(z/2)^n/Gamma[n+1/2]/Gamma[1/2]*(1-t^2)^(n-1/2)*Cos[z t],Der[t], {Der[z],S[n]}]

Test[t^(-n-1)*Exp[t-z^2/(4t)], Der[t], {S[n],Der[z]}]

Test[Sin[z t](1-t^2)^(n+1/2),Der[t], {S[n],Der[z]}]

Test[Exp[-z t](1+t^2)^(n-1/2),Der[t], {S[n],Der[z]}]

Test[BesselJ[n,b t]*Exp[-p^2*t^2]*t^(n+1),Der[t], {Der[b],S[n],Der[p]}]

Test[t^n*BesselY[n,a t]/(t^2+k^2),Der[t], {S[n],Der[a],Der[k]}]

Test[Exp[-p^2*t^2]*BesselJ[0,a t]*BesselY[0,a t]*t,Der[t],{Der[a],Der[p]}]

Test[z^(n+1)*BesselI[n,z],Der[z],{S[n]}]

Test[t^(a-1)*(1-t)^(b-1),Der[t],{S[a],S[b]}]

Test[Exp[-a t]*StruveH[0,t],Der[t],{Der[a]}]

Test[AiryAi[2^(2/3)*(u^2+x)],Der[u],{Der[x]}]

TimeUsed[] - st

2. A longer one

Test[2/Pi*BesselJ[m+n,2z t]*ChebyshevT[m-n,t]/Sqrt[1-t^2],Der[t], {S[m],S[n],Der[z]}]

3. Examples that are hard for redct, or where it needs help

Test[GegenbauerC[l,λ,x]*GegenbauerC[m,λ,x]*GegenbauerC[n,λ,x]*(1-x^2)^(λ-1/2), Der[x], {S[m],S[n],S[l]}]

Test[x BesselJ[1,a x] BesselI[1,a x] BesselY[0,x] BesselK[0,x],Der[x],{Der[a]}]

Test[x BesselJ[1,a x] BesselI[1,a x] BesselY[0,x] BesselK[0,x],Der[a],{Der[x]}]

Test[(c+I*u*Sqrt[1-c^2])^n/Sqrt[1-u^2],Der[u], {S[n],Der[c]}]

Test[Exp[x]*x^(-a/2)/n!*Exp[-t]*t^(n+a/2)*BesselJ[a,2(t*x)^(1/2)],Der[t], {S[n],S[a],Der[x]}]

Bivariate rational integrands

f = 1/(1-y-x/y-x(1-y^2))

Our routine Test does not work directly on these examples, but Christoph Koutschan suggested changing the order of the derivations below, which solves the problem:

ann = Annihilator[f, {Der[y],Der[x]}]

CreativeTelescoping[ann, Der[y], {Der[x]}]

Do[f = 1/(1-y-x/y-x*(1-y^d));ann=Annihilator[f,{Der[y],Der[x]}];tt = Timing[CreativeTelescoping[ann,Der[y],{Der[x]}]];Print[d,"  ",tt[[1]]],{d,12}]

Bivariate Hyperexponential Integrals

f = (62*x-85*y-26)*Sqrt[(-99*x+33*y+62)/(-66*x-63*y+29)]*Exp[(-51*x+86*y-54)/(-51*x-12*y+68)]/(-44*x-y+87)^5

Here, exchanging the order of the derivations does not help, so we use FindCreativeTelescoping instead of CreativeTelescoping:

Timing[FindCreativeTelescoping[f, Der[y], {Der[x]}]][[1]]

?FindCreativeTelescoping

A bigger example:

f = (62*x-85*y-26)*Sqrt[(-99*x+33*y+62)/(-66*x-63*y+29)]*Exp[(-99*x^2+62*x*y+23*y^2+40*x+41*y-87)/(-53*x^2+9*x*y+44*y^2-89*x+40*y+98)]/(-44*x-y+87)^5

TimeConstrained[Timing[FindCreativeTelescoping[f, Der[y], {Der[x]}]],TimeBound]

Bivariate Mixed Terms

f = (1+x/(n^2+1))*((x+1)^2/(x-4)/(x-3)^2/(x^2-5)^3)^n*Sqrt[x^2-5]*Exp[(x^3+1)/x/(x-3)/(x-4)^2]

Test[f,Der[x],{S[n]}]

Test[((z^2-1)/2/(z-x))^n*(1-z)^alpha*(1+z)^beta/(z-x),Der[z],{S[n]}]

Test[(1+x)^(100*n)/x^(n+1),Der[x],{S[n]}]

f = 4*(x*(12*x+10)^2/(87*x+37))^(-n-1)*x*(6*x+5)*(1044*x^2+666*x+185)/(87*x+37)^2

Test[f,Der[x],{S[n]}]

f= 4*(x*(76*x^2-90*x+92)^2/(82*x^2+58*x+65))^(-n-1)*x*(38*x^2-45*x+46)*(9348*x^4+5126*x^3+3358*x^2-8775*x+2990)/(82*x^2+58*x+65)^2

Test[f,Der[x],{S[n]}][[1]]

f = (x*(33*x^4-59*x^3-9*x^2+22*x-99)^2/(86*x^4-37*x^3+94*x^2+80*x-31))^(-n-1)*x*(33*x^4-59*x^3-9*x^2+22*x-99)*(14190*x^8-22548*x^7+29672*x^6-7836*x^5-14523*x^4+4665*x^3+14221*x^2-2046*x+3069)/(86*x^4-37*x^3+94*x^2+80*x-31)^2

Test[f,Der[x],{S[n]}][[1]]

Integrals with Gegenbauer polynomials

f = x^l * GegenbauerC[m,mu,x]*GegenbauerC[n,nu,x]*(-x^2+1)^(nu-1/2)

Test[f/.l->0,Der[x],{S[m],S[n],S[mu],S[nu]}]

Test[f,Der[x],{S[m],S[n],S[l],S[mu],S[nu]}]

F = (x+a)^(g+lambda-1)*(a-x)^(beta-1)*GegenbauerC[m,g,x/a]*GegenbauerC[n,lambda,x/a]

Test[f,Der[x],{S[m],S[n],Der[a],S[beta]}]