ComplexExpand
✖
ComplexExpand
expands expr assuming that variables matching any of the xi are complex.
Details and Options

- The variables given in the second argument of ComplexExpand can be patterns.
- The option TargetFunctions can be given as a list of functions from the set {Re,Im,Abs,Arg,Conjugate,Sign}. ComplexExpand will try to give results in terms of functions specified.
- ComplexExpand automatically threads over lists in expr, as well as equations, inequalities and logic functions.
Examples
open allclose allBasic Examples (4)Summary of the most common use cases
Expand symbolic expressions into real and imaginary parts:

https://wolfram.com/xid/0i1kvjxlu-gk1xuc

Assume that both and
are real:

https://wolfram.com/xid/0i1kvjxlu-837p3e


https://wolfram.com/xid/0i1kvjxlu-dk9pdd

Extract the real and imaginary parts of an expression:

https://wolfram.com/xid/0i1kvjxlu-292n1e

Scope (7)Survey of the scope of standard use cases

https://wolfram.com/xid/0i1kvjxlu-mzchue

Trigonometric and hyperbolic functions:

https://wolfram.com/xid/0i1kvjxlu-h17pcy

Inverse trigonometric and inverse hyperbolic functions:

https://wolfram.com/xid/0i1kvjxlu-deeg6d

Exponential and logarithmic functions:

https://wolfram.com/xid/0i1kvjxlu-cur2us


https://wolfram.com/xid/0i1kvjxlu-ekcug4

Specify that a variable is taken to be complex:

https://wolfram.com/xid/0i1kvjxlu-jt2sm8


https://wolfram.com/xid/0i1kvjxlu-hadptl

Options (1)Common values & functionality for each option
TargetFunctions (1)
This gives an answer in terms of Re[z] and Im[z]:

https://wolfram.com/xid/0i1kvjxlu-ekv4lp

With TargetFunctions->{Abs, Arg}, the answer is given in terms of Abs[z] and Arg[z]:

https://wolfram.com/xid/0i1kvjxlu-i6i3wv

Use Conjugate as the target function:

https://wolfram.com/xid/0i1kvjxlu-ek2gaj

Applications (2)Sample problems that can be solved with this function
This expands the expression, assuming that and
are both real:

https://wolfram.com/xid/0i1kvjxlu-wzj

In this case, is assumed to be real, but
is assumed to be complex, and is broken into explicit real and imaginary parts:

https://wolfram.com/xid/0i1kvjxlu-jkj

With several complex variables, you quickly get quite complicated results:

https://wolfram.com/xid/0i1kvjxlu-ttv

Verify common complex identities:

https://wolfram.com/xid/0i1kvjxlu-b56gd9


https://wolfram.com/xid/0i1kvjxlu-m6badi

Properties & Relations (1)Properties of the function, and connections to other functions
This computes Re[Sin[x+I y]] assuming that x and y are real:

https://wolfram.com/xid/0i1kvjxlu-bpkhhf

The same computation can be done using TrigExpand and Refine:

https://wolfram.com/xid/0i1kvjxlu-b67d3t


https://wolfram.com/xid/0i1kvjxlu-jmdat

Wolfram Research (1991), ComplexExpand, Wolfram Language function, https://reference.wolfram.com/language/ref/ComplexExpand.html (updated 2007).
Text
Wolfram Research (1991), ComplexExpand, Wolfram Language function, https://reference.wolfram.com/language/ref/ComplexExpand.html (updated 2007).
Wolfram Research (1991), ComplexExpand, Wolfram Language function, https://reference.wolfram.com/language/ref/ComplexExpand.html (updated 2007).
CMS
Wolfram Language. 1991. "ComplexExpand." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/ComplexExpand.html.
Wolfram Language. 1991. "ComplexExpand." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/ComplexExpand.html.
APA
Wolfram Language. (1991). ComplexExpand. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ComplexExpand.html
Wolfram Language. (1991). ComplexExpand. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ComplexExpand.html
BibTeX
@misc{reference.wolfram_2025_complexexpand, author="Wolfram Research", title="{ComplexExpand}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/ComplexExpand.html}", note=[Accessed: 09-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_complexexpand, organization={Wolfram Research}, title={ComplexExpand}, year={2007}, url={https://reference.wolfram.com/language/ref/ComplexExpand.html}, note=[Accessed: 09-April-2025
]}