       Re: Manipulating differential equations

• To: mathgroup at smc.vnet.net
• Subject: [mg18617] Re: [mg18552] Manipulating differential equations
• From: "Wolf, Hartmut" <hwolf at debis.com>
• Date: Tue, 13 Jul 1999 01:01:37 -0400
• Organization: debis Systemhaus
• References: <199907100618.CAA02980@smc.vnet.net.>
• Sender: owner-wri-mathgroup at wolfram.com

```Hello Martin,

Martin Heimann schrieb:
>
> Dear colleagues,
>
> I would like to insert test functions into an expression that contains
> differentials:
>
> dg1 = c''[x] + g c'[x]
>
> I would like e.g. to replace c[x] by Exp[-a x]:
>
> dg1/.c[x]->Exp[-a x]
>
> but this doesn't work; one has to put substitution rules for each of the
> derivatives explicitly. Is there a more elegant way to achieve this?
>
you have to substitute the _function_ :

In:= dg1 = c''[x] + g c'[x]//FullForm
Out//FullForm=
Plus[Times[g,Derivative[c][x]],Derivative[c][x]]

In:= dg1/. c->(Exp[-a #]&)
Out//FullForm=
Plus[Times[Power[a,2],Power[E,Times[-1,a,x]]],
Times[-1,a,Power[E,Times[-1,a,x]],g]]

(of course you normally don't define dg1 wrapped in FullForm)

Alternatively you could also localize the function c[x] to Exp[-a x]:

In:= Block[{c},c[x_]:=Exp[-a x];dg1]
Out//FullForm=
Plus[Times[Power[a,2],Power[E,Times[-1,a,x]]],
Times[-1,a,Power[E,Times[-1,a,x]],g]]

---your's hw

```

• Prev by Date: Re: Not Plotting Vertical Assymptotes
• Next by Date: Re: Manipulating differential equations
• Previous by thread: Re: Manipulating differential equations
• Next by thread: Re: Manipulating differential equations