Re: substitution of functions in derivatives
- To: mathgroup at smc.vnet.net
- Subject: [mg3418] Re: [mg3384] substitution of functions in derivatives
- From: jpk at apex.mpe.FTA-Berlin.de (Jens-Peer Kuska)
- Date: Wed, 6 Mar 1996 01:45:59 -0500
- Sender: owner-wri-mathgroup at wolfram.com
>
> I have a problem with mathematica and the rules:
> suppose that I use a function in an expression like:
>
> f=a u[x,y]
>
> next I derivate it:
>
> df=D[f,x]
> now, I'd like to substitute u[x,y] and to give it the good value say Cos[x,y]:
>
> df/.u[x_,y_]->Cos[x y]
>
Hi,
You need a function like
MakeDerivativeRules[fncrule_Rule,x_,y_]:=
Thread[{#,D[#,x],D[#,y],D[#,{x,2}],D[#,{y,2}]} & /@ fncrule]
if You have a differential eqn than Your MakeDerivativeRules may
collect all derivatives that may occour, including cross derivatives.
The rest is easy
df /. MakeDerivativeRules[u[x,y]->Cos[x*y],x,y]
will work.
Hope that helps
Jens
==== [MESSAGE SEPARATOR] ====