MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Derivatives in replacement rules

On Mar 30, 6:39 am, Yi Wang <tririverwan... at> wrote:
> Hi, all,
> When I am using the following replacement rule:
> b[t] c[t] a'[t] /. b_ a_'[t] -> D[b, t]
> I would expect to get D[b[t]c[t], t] = b'[t]c[t] + c'[t]b[t]. However,
> I got 0 actually. To debug, when I set
> b[t] c[t] a'[t] /. b_ a_'[t] -> b
> I get b[t] c[t]. Thus pattern matching works and it appears D[b,t]
> should be non-zero.
> Any ideas how I can get D[b[t]c[t], t] in the above pattern
> replacement? Thanks!

Hi Yi
Use the dalayed rule :> instead of ->

b[t] c[t] a'[t] /. x_ a_'[t] :> D[x, t]

and you will get your expected result

Best regards!

  • Prev by Date: Image Processing Issues
  • Next by Date: Re: simplify Arg[E^(I x)]?
  • Previous by thread: Image Processing Issues
  • Next by thread: Mathematica 8 3D Plot question