MathGroup Archive 2001

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

Search the Archive

RE: complex coefficients and rules...

  • To: mathgroup at
  • Subject: [mg28222] RE: [mg28203] complex coefficients and rules...
  • From: "David Park" <djmp at>
  • Date: Thu, 5 Apr 2001 03:00:35 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


This is one possible method:

myConjugate[expr_] := TrigToExp[ComplexExpand[Conjugate[expr]]]

Exp[-I y] + Exp[-4 I z] // myConjugate
E^(I*y) + E^(4*I*z)

ComplexExpand will expand assuming that variables are real. (You can specify
which ones are complex.) TrigToExp puts the result back into exponential
form, if that is what you want.

A second approach is simple to make your "cumbersome" procedure into a less
cumbersome routine.

myConjugate2[expr_] := expr /. Complex[a_, b_] ->
    Complex[a, -b]

Exp[-I y] + Exp[-4 I z] // myConjugate2
E^(I*y) + E^(4*I*z)

David Park
djmp at

> From: Richard Easther [mailto:easther at]
To: mathgroup at
> Hi,
> I am having some trouble applying some simple rules to complex
> expressions.
> For instance,
>  Exp[-4 I y] /. I-> -I
> yields
>  Exp[-4 I y]
> This seemed a bit odd, so I looked at the "full form" and found,
> Power[E, Times[Complex[0, -4], y]]
> However, trying the match
>  Exp[-4 I y] /. a_ I -> -a I
> doesn't work either, since FullForm[a I ]  is Times[Complex[0, -1], a]
> and so the patterns do not match.
> All I want is a simple complex conjugate (the Conjugate function does
> not assume that y is real), that maps I->-I. The more tricky
>  Exp[-4 I y] /. Complex[a_ ,b_] -> Complex[a,-b]
> does work, but it is seems a little cumbersome.
> In any case my question is: is there a general way to avoid having to do
> this, or is Mathematica always going to assume that any algebraic
> constant is potentially complex?
> Richard

  • Prev by Date: Re: Re: MATHEMATICA WARNING
  • Next by Date: Ordering of output question
  • Previous by thread: Re: complex coefficients and rules...
  • Next by thread: Re: complex coefficients and rules...