# ComplexExpand

ComplexExpand[expr]

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)

Expand symbolic expressions into real and imaginary parts:

Assume that both and are real:

Take to be complex:

Extract the real and imaginary parts of an expression:

## Scope(7)

Polynomials:

Trigonometric and hyperbolic functions:

Inverse trigonometric and inverse hyperbolic functions:

Exponential and logarithmic functions:

Composition of functions:

Specify that a variable is taken to be complex:

Specify target functions:

## Options(1)

### TargetFunctions(1)

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

With , the answer is given in terms of Abs[z] and Arg[z]:

Use Conjugate as the target function:

## Applications(2)

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

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

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

Verify common complex identities:

## Properties & Relations(1)

This computes Re[Sin[x+I y]] assuming that x and y are real:

The same computation can be done using TrigExpand and Refine: