This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# ComplexExpand

 ComplexExpand[expr]expands expr assuming that all variables are real. ComplexExpandexpands expr assuming that variables matching any of the are complex.
• The variables given in the second argument of ComplexExpand can be patterns.
• ComplexExpand automatically threads over lists in expr, as well as equations, inequalities and logic functions.
Assume both x and y are real:
Take x to be complex:
Assume both x and y are real:
 Out[1]=

Take x to be complex:
 Out[1]=
 Scope   (5)
Polynomials:
Trigonometric and hyperbolic functions:
Inverse trigonometric and inverse hyperbolic functions:
Exponential and logarithmic functions:
Composition of functions:
 Options   (1)
This gives an answer in terms of Re[z] and Im[z]:
With TargetFunctions->{Abs, Arg}, the answer is given in terms of Abs[z] and Arg[z]:
Use Conjugate as the target function:
This computes Re[Sin[x+I y]] assuming that x and y are real:
The same computation can be done using TrigExpand and Refine: