3

How can I write a complex function $f(z)$ in the form $u(x,y)+iv(x,y)$ using Mathematica? Re and Im do not work, because they do it for complex numbers, not functions. For example, if I try

Re[2 I (z) + 6 Conjugate[(z)] + Sin[(z)]]

Mathematica returns:

-2 Im[z] + 6 Re[z] + Re[Sin[z]]
Thiago
  • 311
  • 1
  • 9

1 Answers1

4

Replace z with x + I y and use ComplexExpand.

ComplexExpand[2 I z + 6 Conjugate[z] + Sin[z] /. z -> x + I y]
(* 6 x - 2 y + Cosh[y] Sin[x] + I (2 x - 6 y + Cos[x] Sinh[y]) *)