Re: Re: Defining differential operators question

*To*: mathgroup at smc.vnet.net*Subject*: [mg13854] Re: [mg13850] Re: [mg13797] Defining differential operators question*From*: BobHanlon at aol.com*Date*: Mon, 31 Aug 1998 01:09:16 -0400*Sender*: owner-wri-mathgroup at wolfram.com

If you calculate each derivative using Table, you do not make use of the fact that you have already calculated the earlier derivatives. Recommend that you use NestList. Also, why restrict the function to being a Symbol? difOp[coef_List, func_, sym_Symbol:x] := coef.NestList[D[#, sym]&, func, Length[coef]-1] /; Length[coef] > 0 coef = {a0, a1, a2, a3}; difOp[coef, f[x]] a0*f[x] + a1*Derivative[1][f][x] + a2*Derivative[2][f][x] + a3*Derivative[3][f][x] difOp[coef, g[y], y] a0*g[y] + a1*Derivative[1][g][y] + a2*Derivative[2][g][y] + a3*Derivative[3][g][y] difOp[coef, a x^2 + b x + c] 2*a*a2 + a1*(b + 2*a*x) + a0*(a*x^2 + b*x + c) Bob Hanlon In a message dated 8/30/98 4:13:38 AM, jtischer at col2.telecom.com.co wrote: >Hi Tom, >this worked on my PC for your examples: > >NewD[li_List,f_Symbol]:= Evaluate[li. >Table[Derivative[n][f][#],{n,0,Length[li]-1}]]&