I have an expression:
a + b 2^(1/2) + (c + d 2^(1/2))*I
I want to replace each occurrence of 2^(1/2) with -2^(1/2) and each occurrence of I with -I. So I input:
a + b 2^(1/2) + (c + d 2^(1/2)) I /. {2^(1/2) -> -2^(1/2), I -> (-I)}
Mathematica returns:
(* a - Sqrt[2] b - I (c - Sqrt[2] d) *)
as I expected.
Now I want to make the same replacement again on this expression. So I input:
a + b 2^(1/2) + (c + d 2^(1/2)) I /. {2^(1/2) -> -2^(1/2),
I -> (-I)}/. {2^(1/2) -> -2^(1/2), I -> (-I)}
Mathematica returns:
(*a + Sqrt[2] b - I (c + Sqrt[2] d) *)
I do not expect the MINUS sign in the middle of this expression. It seems like it should be PLUS.?
{}button where needed. – Edmund Dec 29 '15 at 18:11a + b 2^(1/2) + (c + d 2^(1/2)) I /. {2^(1/2) -> (-2)^(1/2), I -> (-I)}– Dr. belisarius Dec 29 '15 at 18:15Complex[0, -1] -> I. – march Dec 29 '15 at 18:24c_Complex:> Conjugate[c]( which is in Daniels third link.. ) – george2079 Dec 29 '15 at 19:10