[Date Index]
[Thread Index]
[Author Index]
Re: Re: Problem with transformation rule of a function -- Another one
*To*: mathgroup at smc.vnet.net
*Subject*: [mg53533] Re: [mg53509] Re: [mg53467] Problem with transformation rule of a function -- Another one
*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>
*Date*: Sat, 15 Jan 2005 21:08:18 -0500 (EST)
*References*: <200501150644.BAA25320@smc.vnet.net>
*Sender*: owner-wri-mathgroup at wolfram.com
On 15 Jan 2005, at 07:44, Alain Cochard wrote:
> Thank you so much to those who answered. Now, here is another one.
>
> The following works as I expect:
>
> In[1]:= expr=Integrate[D[g[x,t],t],{x,0,1}]
>
> (0,1)
> Out[1]= Integrate[g [x, t], {x, 0, 1}]
>
> In[2]:= g[x_,t_]:= x f[t]
>
> In[3]:= expr
>
> f'[t]
> Out[3]= -----
> 2
>
> Now I would like to use a transformation rule instead, like in:
>
> In[1]:= expr=Integrate[D[g[x,t],t],{x,0,1}] ;
>
> In[2]:= expr/. g[x,t]->x f[t]
>
> (0,1)
> Out[2]= Integrate[g [x, t], {x, 0, 1}]
>
> I tried various alternatives (with "//", ":>", "Evaluate", using "_"
> or not, with "Hold/ReleaseHold" -- although not in a fully systematic
> way, I admit) without success. Is it feasible?
>
> Thanks,
> Alain
>
>
>
There are several ways. One is
expr /. Derivative[0, 1][g][x, t] :> D[x*f[t], t]
Derivative[1][f][t]/2
another, which I prefer, is:
expr /. g -> Function[{x, t}, x*f[t]]
Derivative[1][f][t]/2
Andrzej Kozlowski
Chiba, Japan
http://www.akikoz.net/~andrzej/
http://www.mimuw.edu.pl/~akoz/
Prev by Date:
**Re: Re: Problem with transformation rule of a function -- Another one**
Next by Date:
**Re: cubic quaternion based surface**
Previous by thread:
**Re: Re: Problem with transformation rule of a function -- Another one**
Next by thread:
**Mathematica 5.1 JLink problem**
| |