Re: global real variables

*To*: mathgroup at smc.vnet.net*Subject*: [mg22047] Re: [mg22019] global real variables*From*: Andrzej Kozlowski <andrzej at platon.c.u-tokyo.ac.jp>*Date*: Fri, 11 Feb 2000 02:38:27 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

on 00.2.10 4:26 PM, Naum Phleger at naum at cava.physics.ucsb.edu wrote: > I asked a dumb question a few weeks ago about making variables real and > found that Mathematica 4 took care of this better. I have been using it > since. I still have a couple of problems with it though. First, I can have > variables be treated as real by using the assumption Element[x,Reals] in a > simplify command, but I want x to be real in all commands so I don't have to > keep using Simplify each time I want x to be recognized as real. Second, > even this doesn't seem to work quite right. Here is what I mean. > > > Say I have tow var.s, x and p. Both are real so I can do this. > > Simplify[ Conjugate[ x ] , Element[ x , Reals ] ] ----> x > > amd I get the same thing for p, but it stops working if I have functions of > x and p, for instance I get > > > Simplify[ Conjugate[ x + x * p^-1 ] , Element[ {x,p} , Reals ] ] ----> > > Conjugate[ x + x * p^-1 ] > > > It works if I use FullSimplify AND put p^-1 into the list of variables > that I want to have real. How can I get around this without listing every > negative power of every variable and wasting time with FullSimplify. Thanks > for any help. Thanks. > > > -NAUM > This particular case can be best dealt with by using ComplexExpand: In[1]:= ComplexExpand[Conjugate[ x + x * p^-1 ]] Out[1]= x x + - p ComplexExpand assumes that all the variables are real. If, for example, you had another variable, say a, which you do not want to assume to be real you can use: In[3]:= ComplexExpand[Conjugate[ x + x * p^-1 + a], {a}] Out[3]= x x + - - I Im[a] + Re[a] p In certain cases you may need to combine Simplify with ComplexExpand (you can find a number of such examples in the archives of this list). -- Andrzej Kozlowski Toyama International University Toyama, Japan http://sigma.tuins.ac.jp/