ComplexExpand

(SymPy, WMA)


ComplexExpand[expr]

expands expr assuming that all variables are real.

ComplexExpand[expr,{$x_1$,$x_2$, ...}]

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

Note: we get equivalent, but different results from WMA:

Assume that both x and y and are real:

Take x to be complex:

Polynomials:

Trigonometric and hyperbolic functions

Exponential and logarithmic functions:

Specify that variable z is taken to be complex:

ArcTanh
Cosh