Expand into real and imaginary parts (complex_expand)
Expand an expression assuming its variables are real.
How to write it
complex_expand(expr)
- expr
- Any expression: a number, a formula, a list or a matrix. Takes an expression.
Examples
complex_expand((1 + i)^2)In the solver,
Open in the solvercomplex_expand((1 + i)^2)gives2i.
Related functions
- expand
Multiply out products and powers into a sum.
- function_expand
Rewrite special functions of shifted arguments in terms of simpler ones.
- power_expand
Expand powers and logarithms of products and powers.
- cyclotomic
Cyclotomic polynomial of a given order.
- collect
Group the terms of an expression by powers of a variable.
- degree
Degree of a polynomial in a variable.