Message Boards Message Boards

0
|
9238 Views
|
7 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Conjugate and Simplify

Posted 4 years ago

(I am using Mathematica 12)

I hope I am not fooling myself, but why does Mathematica not evaluate the following expression to zero:

Conjugate[a] Conjugate[b] - Conjugate[a b]

Even if I explicitly specify that a and b are complex, the expression is not evaluated:

Simplify[Conjugate[a] Conjugate[b] - Conjugate[a b], Assumptions -> {a, b} \[Element] Complexes]

Only when I give explicit numerical values, the simplification is done.

POSTED BY: Daniel Huber
7 Replies

There is a problem with your conjugate:

conjugate[z_] := z /. I -> -I;
conjugate[1 + I]

You may try with this more sophisticated version:

conjugate[z_] := z /. Complex[a_, b_] :> Complex[a, -b];

but it may not be enough, when the number has no explicit I:

conjugate[z_] := z /. Complex[a_, b_] :> Complex[a, -b];
z = (-1)^Pi
conjugate[z] == Conjugate[z]
N[{conjugate[z], Conjugate[z]}]
POSTED BY: Gianluca Gorni
Posted 7 months ago

The problem with Conjugate[] is that it is a Numerical Function:

In[80]:= Attributes[Conjugate]

Out[80]= {Listable, NumericFunction, Protected, ReadProtected}

and it doesn't seem to work on symbols. The same is true of Re[], Im[] and Abs[].:
E.g..

In[2]:= Head /@ {a, b}

Out[2]= {Symbol, Symbol}

In[1]:= Re[a + b I]

Out[1]= -Im[b] + Re[a]

That doesn't even make sense. Why would the real part of a complex number include the negative of the imaginary part of symbol b. Apparently, trying to take the real part confuses MMA so that it can't compute correctly. Hence,

In[11]:= z = a + b I

Conjugate@z

Out[11]= a + I b

Out[12]= Conjugate[a] - I Conjugate[b]

If Conjugate[] knew that a and b were Reals, it would know that Conjugate [Real x] =x, etc. So I devised my own simple function:

In[77]:= z = a + b I

conjugate[z_] := z /. I -> -I;
conjugate[z]

Out[77]= a + I b
Out[79]= a - I b

..useful for more complicated expressions:

In[61]:= a E^(I x) a conjugate[E^(I x)]

Out[61]= a^2
POSTED BY: Mark Harder
Posted 4 years ago

It should be noted that ComplexExpand[] makes the implicit assumption that the symbols given to it are real-valued unless otherwise indicated in its second argument, so the correct way to go about this is ComplexExpand[Conjugate[a] Conjugate[b] - Conjugate[a b], {a, b}].

POSTED BY: J. M.
Posted 4 years ago

The Assumptions should not even be necessary here; FullSimplify[Conjugate[a] Conjugate[b] - Conjugate[a b]] by itself will work.

POSTED BY: J. M.
Posted 4 years ago

Thank's a lot for the answers. But it would be interesting to know the reason behind this unexpected behaviour.

POSTED BY: Daniel Huber
Posted 4 years ago
ComplexExpand[Conjugate[a] Conjugate[b] - Conjugate[a b]]
POSTED BY: Hans Milton

Try:

FullSimplify[Conjugate[a] Conjugate[b] - Conjugate[a b], Assumptions -> {a, b} \[Element] Complexes]

(* 0 *)

Regards M.I.

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract