# $Source: /u/maple/research/lib/DEtools/diffop/src/RCS/integrate_sols,v $ # $Notify: mvanhoei@daisy.uwaterloo.ca $ # The goal of this file is to compute an M of minimal order such that # diff( DEsols(M) ,x) = DEsols(L) # (so that I can replace Int(DEsols(L)) by something nicer). # Note that the algorithm is also applicable for the difference # case, so it may be useful for the LREtools package. # However, it may be better to wait until we have # a Ore_algebra[ratsols] so that it can be written in a # more general way. macro( x=`DEtools/diffop/x`, DF=`DEtools/diffop/DF`, adjoint=`DEtools/diffop/adjoint`, leftdivision=`DEtools/diffop/leftdivision`, integrate_sols=`DEtools/diffop/integrate_sols` ): # ISSAC'97 Abramov/Hoeij integrate_sols:=proc(L) global x,DF; local A,l,i,d,r; option `Copyright (c) 1997 Waterloo Maple Inc. All rights reserved.`; # adjoint(L) has a factor of (-1)^degree(L,DF), so that adjoint(DF)=DF # instead of adjoint(DF)=-DF # However, here we shouldn't have this (-1)^degree(L,DF) so I multiply # it away. A:=normal((-1)^degree(L,DF)*adjoint(L)); d:=denom(A); A:=collect(numer(A),DF); l:=`DEtools/ratsols`( [seq(coeff(A,DF,i),i=0..degree(A,DF))],d,x); if nops(l)=1 then # no rational solutions L*DF else l:=l[2]; # found a rational solution # r satisfies: DF*r=1-l*L # r:=adjoint(quo(adjoint(1-l*L),DF,DF)); r:=leftdivision(1-l*L,DF); if r[2]<>0 then error "Remainder should be zero" fi; r:=r[1]; # Ltilde=1-r*DF [collect(1-r*DF,DF),r] fi end: #savelib('integrate_sols'):