next up previous contents
Next: Symbolic Transformations Up: Polynomials (2) and Rational Previous: Division, Greatest Common Denominator

Real- and Imaginary Part

realpart(expression) and imagpart(expression) is used to decompose complex expressions. Symbolic variables in these expressions are assumed to be real-valued.
>> syms x
>> y=(3+i*x)/(2-i*x)
y = (-x+3i)/(x+2i)
>> realpart(y)
ans = (-x^2+6)/(x^2+4)
>> imagpart(y)
ans = 5*x/(x^2+4)

Helmut Dersch