# Defining a General Complex Number

I am trying to compute the Complex conjugate of two complex numbers multiplied together. However, when I go to define my complex numbers as $a+b I$ and $c+dI$ it does not like $b$ and $d$ because they are complex. I have tried to use Assumptions, but it also does not like that. Any ideas on how to define a and b to be real numbers?

z1 = a + b I, Assumptions -> {a, b} \[Element] Reals


Ideally what I would like is to have something of form

Simplify[Conjugate[z1 z2], {a,b,c,d} \[Element] Reals] \\Expand


which is what worked, but what does the \Expand part do? I know it expands it out but why the \ attached to it? What does that do to it?

• Collect[(a + b j) (c + d j), j] /. j -> -I Commented Sep 17, 2015 at 14:01
• you are right. Now I would like to be able to define a and b as real numbers Commented Sep 17, 2015 at 14:03
• "define a and b as real numbers"? Mathematica isn't typed language... Commented Sep 17, 2015 at 14:13
• See also ComplexExpand. Commented Sep 17, 2015 at 14:30
• As for your last question, \Expand is bad syntax. Probably you meant // Expand. In order to understand what // is, highlight it and hit F1. Commented Sep 17, 2015 at 16:22

I think Assumptions can be used in general like this

## Method 1

First let us define the general list of reals

$Assumptions = {(a|b|c|d) \[Element] Reals}  Now you can check that it works. Simplify[Conjugate[(a + b I) (c + d I)]] (*(a - I b) (c - I d)*)  ## Method 2 Instead of defining all your variables separately, you can in fact define a real array and use the array elements as your variable Here t is the real array $Assumptions = {(t[_]) \[Element] Reals}


Then you can use the array elements t

  Simplify[Conjugate[(t[1] + t[2] I) (t[3] + t[4] I)]]
(*(t[1] - I t[2]) (t[3] - I t[4])*)


## Method 3

I'm not sure if this is a good practice but it seems that I can make everything to be real like this

 \$Assumptions = {(_) \[Element] Reals}


How simple is this?

Conjugate[(a + b I) (c + d I)] // ComplexExpand
a c - b d + I (-b c - a d)


Assumptions can not be used in general. It is specific to certain functions such as Simplify, Refine, Integrate ... as explained in the document here

In order to get the desired result use:

Simplify[Conjugate[(a + b I) (c + d I)],
Assumptions -> a ∈ Reals && b ∈ Reals && c ∈ Reals && d ∈ Reals]


For Simplify the second argument is the assumptions so you don't have to specify that explicity.

Simplify[Conjugate[(a + b I) (c + d I)],
a ∈ Reals && b ∈ Reals && c ∈ Reals && d ∈ Reals]

• When I use that, my output is (c - I d) (a + Conjugate[bI]) Commented Sep 17, 2015 at 14:08
• @JackArmstrong - If you are getting Conjugate[bI], you left out the space or asterisk between b and I Commented Sep 17, 2015 at 14:51

You may do it this way:

z1 = a + I*b;
z2 = c + I*d;

expr = Simplify[z1*z2 // Conjugate, {a, b, c, d} \[Element] Reals] //
Expand

(*  a c - I b c - I a d - b d  *)


Then like this:

(expr /. Complex[0, -1] -> 0) + Factor[expr - (expr /. Complex[0, -1] -> 0)]

(*  a c - b d - I (b c + a d)   *)


Alternatively, like this:

expr[[1]] + expr[[4]] + Factor[Take[expr[[2 ;; 3]]]]

(*  a c - b d - I (b c + a d)   *)


But if you claim that it is uncomfortable not to have a simple function for this kind of things, I agree.

Have fun!