I have a problem understanding how Mathematica handles real values in complex numbers. E.g.
a \[Element] Reals;
b \[Element] Reals;
z = a + b I;
t = z^2 + Conjugate[z]
gives the somewhat unexpected answer
(a + I b)^2 + Conjugate[a] - I Conjugate[b]
while
t = z^2 + Conjugate[z] // ComplexExpand
gives the more 'correct'
a + a^2 - b^2 + I (-b + 2 a b)
I don't understand why Conjugate does not compute to a - b i in the first case.
Further,
Re[t]
does not give the expected
a + a^2 - b^2
but instead
-Im[-b + 2 a b] + Re[a + a^2 - b^2]
which I don't understand.
Is there someone that could kindly explain this to me, and perhaps link to some document that have 'exercises' in complex arithmetic using Mathematica that one could practise on? TIA.