Re: how to specify something is "real"
- To: mathgroup at smc.vnet.net
- Subject: [mg43166] Re: how to specify something is "real"
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Sat, 16 Aug 2003 02:53:50 -0400 (EDT)
- References: <bhi5j3$hne$1@smc.vnet.net>
- Reply-to: "Allan Hayes" <hay at haystack.demon.co.uk>
- Sender: owner-wri-mathgroup at wolfram.com
"pgp" <bla at bla.com> wrote in message news:bhi5j3$hne$1 at smc.vnet.net... > Hi, > This is probably a dumb question, but I was trying to use Conjugate[] on an > expression that contains terms like Cos[x], and mathematica doesn't take it > for granted that Cos[x] is real, and hence the end result contain lots of > Conjugate's that can't be reduced. > Could someone tell me if it's possible to tell mathematica which parts of > the expressions are supposed to be real, so it'll get rid of all those > Conjugates? > Thanks a lot. > -K On an expression by expression basis (ComplexExpand assumes that all variables are real unless told otherwise): In[1]:= ComplexExpand[Conjugate[Cos[x]]] Out[1]= Cos[x] Globally, We can use the package ReIm: In[2]:= << Algebra`ReIm` In[3]:= x /: Im[x] = 0; (*note the definition is for x, via x/:*) In[4]:= Conjugate[Cos[x]] Out[4]= Cos[x] Allan --------------- Allan Hayes hay at haystack.demon.co.uk Voice: +44 (0)116 241 8747 Fax: +44 (0)870 164 0565