RE: Replacement rules with I (sqrt(-1)
- To: mathgroup at smc.vnet.net
- Subject: [mg45059] RE: [mg45053] Replacement rules with I (sqrt(-1)
- From: "David Park" <djmp at earthlink.net>
- Date: Mon, 15 Dec 2003 06:02:53 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Jean-Michel, This certainly used to confuse me - until I looked at the FullForm. I // FullForm Complex[0, 1] x + I y // FullForm Plus[x, Times[Complex[0, 1], y]] So x + I y contains I and the rule matches. 3 + I // FullForm Complex[3, 1] which doesn't contain I (i.e., Complex[0,1]) and therefore the rule doesn't match. There is a difference between complex expressions and complex numbers. You could use the rule: conjrule = Complex[a_, b_] -> Complex[a, -b] x + I y /. conjrule x - I y 3 + I /. conjrule 3 - I or you also could use: 3 + I // Conjugate 3 - I x + I y // Conjugate // ComplexExpand x - I y David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Jean-Michel Collard [mailto:jm at france-paris.org] To: mathgroup at smc.vnet.net Can someone explain me this particular behavior : x+I*y /. I -> -I x-I y (* ok *) 3+I /. I-> -I 3+I (* ????? false *) Regards, J.-M.