This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

ComplexExpand

ComplexExpand[expr]
expands expr assuming that all variables are real.
ComplexExpand
expands 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:
In[1]:=
Click for copyable input
Out[1]=
 
Take x to be complex:
In[1]:=
Click for copyable input
Out[1]=
Polynomials:
Trigonometric and hyperbolic functions:
Inverse trigonometric and inverse hyperbolic functions:
Exponential and logarithmic functions:
Composition of functions:
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:
New in 2 | Last modified in 6