Re: [Q] Differential operators <--> polynomials
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg1277] Re: [Q] Differential operators <--> polynomials
- From: beretta at ATHENA.MIT.EDU (Robert K Beretta)
- Date: Wed, 31 May 1995 03:55:43 -0400
- Organization: Massachusetts Institute of Technology
In article <3q3m05$mc5 at news0.cybernetics.net> ozan at matematik.su.se (Ozan \Vktem) writes: > > I would like to be able to "convert" a polynomial to its associated >differential operator. I am pretty sure that this is done, but I could not >find it anywhere. A package that works like the example below would be >very nice to have. > >Example: The package provides the command "DPoly" and > > DPoly[12 x^2+3 x-2,f[b,s],b] > > should be equivalent to > > 12 D[f[b,s],{b,2}]+3 D[f[b,2],b]-2 f[b,s] > How about: In[1]:= DPoly[poly_, xvar_, func_, dvar_]:= CoefficientList[12 x^2 + 3 x - 2, xvar] . Table[D[func[dvar], {dvar, i}], {i, 0, Exponent[poly, xvar]}] In[2]:= DPoly[12 x^2+3 x-2, x, f, b] Out[2]= -2 f[b] + 3 f'[b] + 12 f''[b] In[3]:= DPoly[12 x^2+3 x-2, x, f[#, s]&, b] Out[3]= (1,0) (2,0) -2 f[b, s] + 3 f [b, s] + 12 f [b, s] Hope this helps, Bob Beretta beretta at mit.edu