MathGroup Archive 1992

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

Search the Archive


  • To: mathgroup at
  • Subject: Replace
  • From: tuk at (John Pender)
  • Date: Thu, 8 Oct 92 10:25:03 YDT

hi guys-
i have an annoying little problem with the replace command (/.).  the ultimate
goal is to define a function which takes the complex conjugate of a symbolic
expression by replacing I everywhere with -I.  this assumes implicity that all
of the variables in the expression (except for I itself) are real.  the problem
boils down to the fact that mma seems to treat I in a special way.  in
particular, watch this:

Mathematica 2.1 for SPARC
Copyright 1988-92 Wolfram Research, Inc.
 -- SunView graphics initialized -- 

In[1]:= v /. v->-v

Out[1]= -v

In[2]:= 5 v /. v->-v

Out[2]= -5 v         *********  no problem so far.

In[3]:= I /. I->-I

Out[3]= -I	    *********** still no problem

In[4]:= 5 I /. I->-I

Out[4]= 5 I        *************  what the hell?

the fact that mma won't make the substitution if there is anything in front of
I in the expression of interest blows the whole deal.  

thanks in advance for any help.

john pender
tuk at

  • Prev by Date: Plotting interpolating functions
  • Next by Date: Mma vectors do not have to be one-dimensional
  • Previous by thread: Plotting interpolating functions
  • Next by thread: Re: Replace