WOLFRAM

expands expr assuming that all variables are real.

ComplexExpand[expr,{x1,x2,}]

expands expr assuming that variables matching any of the xi are complex.

Details and Options

Examples

open allclose all

Basic Examples  (4)Summary of the most common use cases

Expand symbolic expressions into real and imaginary parts:

Out[1]=1

Assume that both and are real:

Out[1]=1

Take to be complex:

Out[1]=1

Extract the real and imaginary parts of an expression:

Out[1]=1

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

Polynomials:

Out[1]=1

Trigonometric and hyperbolic functions:

Out[1]=1

Inverse trigonometric and inverse hyperbolic functions:

Out[1]=1

Exponential and logarithmic functions:

Out[1]=1

Composition of functions:

Out[1]=1

Specify that a variable is taken to be complex:

Out[1]=1

Specify target functions:

Out[1]=1

Options  (1)Common values & functionality for each option

TargetFunctions  (1)

This gives an answer in terms of Re[z] and Im[z]:

Out[1]=1

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

Out[2]=2

Use Conjugate as the target function:

Out[3]=3

Applications  (2)Sample problems that can be solved with this function

This expands the expression, assuming that and are both real:

Out[1]=1

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

Out[2]=2

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

Out[3]=3

Verify common complex identities:

Out[1]=1
Out[2]=2

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:

Out[1]=1

The same computation can be done using TrigExpand and Refine:

Out[2]=2
Out[3]=3
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).

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 ]}

@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 ]}

@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 ]}