REL1 := (a-b1-b2)*F1(a,b1,b2,c,x,y) -a*F1(a+1,b1,b2,c,x,y) +b1*F1(a,b1+1,b2,c,x,y) +b2*F1(a,b1,b2+1,c,x,y): REL2 := c*F1(a,b1,b2,c,x,y) -(c-a)*F1(a,b1,b2,c+1,x,y) -a*F1(a+1,b1,b2,c+1,x,y): REL3 := c*F1(a,b1,b2,c,x,y) +c*(x-1)*F1(a,b1+1,b2,c,x,y) -(c-a)*x*F1(a,b1+1,b2,c+1,x,y): REL4 := c*F1(a,b1,b2,c,x,y) +c*(y-1)*F1(a,b1,b2+1,c,x,y) -(c-a)*y*F1(a,b1,b2+1,c+1,x,y): REL5 := subs(b1=b1+1,REL4) - subs(b2=b2+1,REL3): F1 := proc(a,b1,b2,c,x,y) options remember; local L,aa,cc,bb,v,i; v := [args]; if type(a,`+`) then L := [op(a)]; for i in L do if type(i,posint) then aa := a-1; return ( b1*procname(aa,b1+1,b2,c,x,y)+ b2*procname(aa,b1,b2+1,c,x,y)+ (aa-b1-b2)*procname(aa,b1,b2,c,x,y))/aa fi od: fi; if type(c,`+`) then L := [op(c)]; for i in L do if type(i,posint) then cc := c-1; return ( (-y*a*x+y*cc*x-b2*x-y*b1)*procname(a,b1,b2,cc,x,y) -b2*x*(y-1)*procname(a,b1,b2+1,cc,x,y) -y*b1*(x-1)*procname(a,b1+1,b2,cc,x,y) ) * cc/x/(a-cc)/y/(b1-cc+b2) fi od fi; # Want to verify this one: if type(b1,`+`) and type(b2,`+`) and add(`if`(type(i,posint),1,0),i=b1)*add(`if`(type(i,posint),1,0),i=b2)>0 then return (-y*procname(a,b1-1,b2,c,x,y)+procname(a,b1,b2-1,c,x,y)*x)/(-y+x) fi; # OK but causes loop. if type(b1,`+`) then L := [op(b1)]; for i in L do if type(i,posint) and i>1 then bb := b1-2; return ( (y*bb+y-c*y+b2*y)*procname(a,bb,b2,c,x,y)+ (-2*y+y*x+c*y-b2*x-b2*y+y*bb*x-y*a*x+b2*x*y-2*y*bb)*procname(a,bb+1,b2,c,x,y)+ (-b2*x*y+b2*x)*procname(a,bb+1,b2+1,c,x,y) )/y/(x-1)/(bb+1) fi od fi: if type(b2,`+`) then L := [op(b2)]; for i in L do if type(i,posint) and i>1 then bb := b2-2; return ( (b1*x-c*x+bb*x+x)*procname(a,b1,bb,c,x,y)+ (-y*b1-b1*x+y*b1*x-2*bb*x+bb*x*y-y*a*x-2*x+c*x+y*x)*procname(a,b1,bb+1,c,x,y)+ (-y*b1*x+y*b1)*procname(a,b1+1,bb+1,c,x,y) )/x/(y-1)/(bb+1) fi od fi: 'F1'(args) end: # ToProve := y*F1(a,b1,b2+1,c,x,y)-F1(a,b1+1,b2,c,x,y)*x+(-y+x)*F1(a,b1+1,b2+1,c,x,y); # normal(REL5); indetsF := proc(a) global F; local i; {seq(`if`(op(0,i) = F1, i, NULL), i = indets(a,function))} end: diffF := proc() local s; s := diff_F(args); collect(s, indetsF(s), factor) end: diff_F := proc(r, x) local id,s,c; if nargs = 1 then return r elif nargs>2 then return procname(procname(r,x), args[3..-1]) fi; id := indetsF(r); if id = {} then diff(r,x) else s := collect(r, id); if type(s,`+`) then map(procname, s, x) elif nops(id)=1 then c := coeff(s, id[1], 1); if s = c*id[1] then diff(c,x)*id[1] + c*diffF1(id[1], x) else error "not implemented" fi fi fi end: diffF1 := proc(f, x) global F1; local a,b1,b2,c,v1,v2; if op(0,f) <> F1 then error "wrong arguments" fi; a,b1,b2,c,v1,v2 := op(f); `if`(has(v1,x), diff(v1,x) * a*b1/c * F1(a+1, b1+1, b2 , c+1, v1,v2), 0) + `if`(has(v2,x), diff(v2,x) * a*b2/c * F1(a+1, b1 , b2+1, c+1, v1,v2), 0) end: EQN := proc(f,x) local id, c,isz,fd,i; isz := c[0]*f; fd := f; for i to 3 do fd := diffF(fd,x); isz := isz + c[i]*fd od; id := indetsF(isz); id := solve({c[3]-1,coeffs(collect(isz,id),id)}, {seq(c[i],i=0..3)}); collect(eval(add(c[i]*Dx^i,i=0..3), id),Dx,factor) end: