Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9310 > unrolled thread
| Started by | Yi Wang <tririverwangyi@gmail.com> |
|---|---|
| First post | 2012-03-30 09:39 +0000 |
| Last post | 2012-04-02 08:24 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Derivatives in replacement rules Yi Wang <tririverwangyi@gmail.com> - 2012-03-30 09:39 +0000
Re: Derivatives in replacement rules Rodrigo Murta <murta@rodrigomurta.com> - 2012-04-02 08:24 +0000
| From | Yi Wang <tririverwangyi@gmail.com> |
|---|---|
| Date | 2012-03-30 09:39 +0000 |
| Subject | Derivatives in replacement rules |
| Message-ID | <jl3v1b$3mi$1@smc.vnet.net> |
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!
[toc] | [next] | [standalone]
| From | Rodrigo Murta <murta@rodrigomurta.com> |
|---|---|
| Date | 2012-04-02 08:24 +0000 |
| Message-ID | <jlbnn6$434$1@smc.vnet.net> |
| In reply to | #9310 |
On Mar 30, 6:39 am, Yi Wang <tririverwan...@gmail.com> 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! Murta
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web