Mathematica for Sections 6.5 and 6.6 (evaluated)

$VersionNumber

Section 6.5

B[h_,i_,j_][z_]:=0/;i≤-1

B[h_,0,j_][z_]:=1;

B[h_,i_,j_][z_]:=Sum[D[B[h,i-1,k][z],z]-k(2h+k-1)a[m,n][z]*B[h,i-2,k-1][z],{k,i-1,j-1}]/;i≥1

Ce[p_,q_,r_,mu_]:=FunctionExpand[(-1)^mu*Binomial[r,mu]*Binomial[2q+r-1,mu]/Binomial[2p+mu-1,mu]]

A[p_,q_,r_,s_,t_][z_]:=Sum[Ce[p,q,r,t+k]*B[p,k,t+k][z]*B[q,s-k,r-t-k][z],{k,0,s}]

poly[p_,q_,r_,P_,Q_][z_]:=Module[{expr,mon},mon=Join[Table[D[a[m,n][z],{z,i}],{i,0,r-2}],Table[D[P[z],{z,j}],{j,0,r}],Table[D[Q[z],{z,k}],{k,0,r}]];
expr=Sum[A[p,q,r,s,t][z]*Derivative[t][P][z]*Derivative[r-s-t][Q][z],{s,0,r},{t,0,r-s}];
Collect[expr,mon,Factor]]

poly[p,q,2,P,Q][z]

poly[p,q,3,P,Q][z]

poly[p,q,4,P,Q][z]

Section 6.6

Together[poly[r,p+q,2,R,Function[x,P[x]*Q[x]]][z]+(2p/(2q+1))R[z]*poly[p,q,2,P,Q][z]-((2p+2q+1)/(2q+1))P[z]*poly[r,q,2,R,Q][z]-((2p+2q+1)/(2p+1))Q[z]*poly[r,p,2,R,P][z]]

Together[R[z]*poly[p,q,2,P,Q][z]+(r(2q+1)(2r+1)/(2p(p+q+r+1)(2p+2q+2r+1)))*poly[r,p+q,2,R,Function[x,P[x]*Q[x]]][z]-((2q+1)(2p+2q+1)/(2(p+q+r+1)(2p+2q+2r+1)))*poly[p,q+r,2,P,Function[x,Q[x]*R[x]]][z]-(q(2q+1)(2p+2q+1)/(2p(p+q+r+1)(2p+2q+2r+1)))*poly[q,p+r,2,Q,Function[x,P[x]*R[x]]][z]]