<< HolonomicFunctions.m

HolonomicFunctions package by Christoph Koutschan, RISC-Linz, Version 1.4 (10.11.2010)
⟶ Type  ?HolonomicFunctions  for help

(* General information on HolonomicFunctions *)

?HolonomicFunctions

ann=Annihilator[Sum[Binomial[n,k] LegendreP[k,x],{k,0,n}],{S[n]}]

Factor[ann]

(* executing closure properties *)

ann1 = Annihilator[LegendreP[k,x],{S[k]}]

ann2 = Annihilator[Binomial[n,k],{S[k]}]

ann = Factor[DFiniteTimes[ann1,ann2]]

(* available routines executing closure properties *)

?DFinite*

(* creative telescoping in HolonomicFunctions *)

CreativeTelescoping[Binomial[n,k] LegendreP[k,x],S[k]-1,S[n]]

(* recurrence for L^2-orthogonal basis functions on triangles *)

ann = Factor[Annihilator[LegendreP[i,2x/(1-y)] ((1-y)/2)^i JacobiP[j,2i+1,0,y],{S[i],S[j]}]];

Support[ann]

(* the first part is merely the three term recurrence for Jacobi polynomials JacobiP[j,2i+1,0,y] *)

First[ann]

ann = Factor[Annihilator[LegendreP[i,2x/(1-y)] ((1-y)/2)^i JacobiP[j,2i+1,0,y],{S[i],S[j],Der[x],Der[y]}]];

Support[ann]

(* conversion monomial basis to Legendre polynomials *)

ann = Annihilator[Integrate[x^k LegendreP[n,x],{x,-1,1}],{S[k],S[n]},Assumptions->Element[k,Integers] && Element[n,Integers]]

ApplyOreOperator[ann,a[k,n]]

(* without the assumptions the delta part cannot be evaluated *)

ann = Annihilator[Integrate[x^k LegendreP[n,x],{x,-1,1}],{S[k],S[n]}]

(* one option is to ask to return the delta part (as earlier in the CreativeTelescoping example) and do the evaluation oneself *)

ann = Annihilator[Integrate[x^k LegendreP[n,x],{x,-1,1}],{S[k],S[n]},Inhomogeneous->True]

rem = Last[%]

(* use the knowledge that Legendre polynomials at x=-1 evaluate to (-1)^n *)

rem/.LegendreP[n_,-1]->(-1)^n

%//FullSimplify