Re: Defining a derivative that distributes for a function
- To: mathgroup at smc.vnet.net
- Subject: [mg64263] Re: Defining a derivative that distributes for a function
- From: "Sasha P" <mathpro.admin at gmail.com>
- Date: Wed, 8 Feb 2006 03:54:02 -0500 (EST)
- References: <ds9mqp$48$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Dear Andreas,
Instead of redefining D operator, consider introducing customized
\[ScriptCapitalD] which you type as "Esc" scD "Esc". Then
In[1]:=
\[ScriptCapitalD][expr_, x__] /; FreeQ[expr, f[_]] := D[expr, x];
\[ScriptCapitalD][expr_, x__] := Module[{t = D[expr, x]},
t /. {Derivative[n_Integer /; n > 1][f][z_] -> 0} /.
{Derivative[1][f][z_] :> (1/D[z, x])*f[D[z, x]]}]
In[6]:=
\[ScriptCapitalD][f[x^2] + f[x^4], x]
Out[6]=
f[2*x] + f[4*x^3]
In[7]:=
\[ScriptCapitalD][f[x^2] + f[x^4], {x, 2}]
Out[7]=
f[2] + f[12*x^2]
In[10]:=
\[ScriptCapitalD][f[x^2]*f[x^4], {x, 2}]
Out[10]=
(2/3)*x^2*f[2]*f[12*x^2] + f[x^2]*f[12*x^2] + f[2]*f[x^4]
Hope this is what you aimed at.
Regards,
Sasha