# Summing complex numbers

Maybe it is a very stupid question but I am having trouble with summing complex numbers in Mathematica. I have

q = l1 E^(2 π I t1) + l2  E^(2 π I t2)


where l1, l2 t1, and t2 are known real numbers. I obtain an answer which is a set of four complex numbers.

I think it sums all the components one by one (Minkowski sum?), and I want just to sum two complex numbers to obtain a third one. What function should I use?

• You might want to look at ComplexExpand[]. – J. M. will be back soon Jul 11 '15 at 12:29
• What do you mean by "2[Pi]"? – Peltio Jul 11 '15 at 12:30
• @Peltio, Markdown strips backslashes, unfortunately. I've fixed it. – J. M. will be back soon Jul 11 '15 at 12:37
• q // ExpToTrig // Simplify is equivalent to q//ComplexExpand in this case. – Bob Hanlon Jul 11 '15 at 13:16

Since l1, l2, t1, t2 are known, you just need to plug them in:

q=l1 E^(2 \[Pi] I t1) + l2 E^(2 \[Pi] I t2) /. {l1->0.2, t1->0.1, l2->5, t2->-1}


gives 5.1618 + 0.117557 I

   q1 = l1 E^(2 \[Pi] I t1) + l2 E^(2 \[Pi] I t2)

q2 = q1 // ExpToTrig

(Drop[q2, 2] // Factor) + Drop[q2, -2]

(*  E^(2 I \[Pi] t1) l1 + E^(2 I \[Pi] t2) l2

l1 Cos[2 \[Pi] t1] + l2 Cos[2 \[Pi] t2] + I l1 Sin[2 \[Pi] t1] +
I l2 Sin[2 \[Pi] t2]

l1 Cos[2 \[Pi] t1] + l2 Cos[2 \[Pi] t2] +
I (l1 Sin[2 \[Pi] t1] + l2 Sin[2 \[Pi] t2])  *)


Have fun!