
Im - imaginary part of an expression

Calling sequence:
Im(expr)

Parameter:

expr   --  expression

Overloading:

All

Summary:

Im returns the imaginary part of any expression. For this the method "Im"
from the domain of expr is used. If this domain does not have such a method
then the function returns the expression Im(expr).

Exceptions to this are expressions of the type DOM_INT, DOM_RAT, DOM_FLOAT,
DOM_COMPLEX and DOM_EXPR, which are processed directly by the function Im.

For expressions with the type DOM_EXPR the determination of the imaginary
part of an expression can be defined under the function attribute "Im" in
the form of a procedure or a function. If the operator of expr has such an
attribute then the procedure or function under the entry of the attribute "Im"
is called with the operands of the argument expr and the result is returned.

If such a function attribute is not defined and the operator of expr is one
of the function environments _plus, _mult or _power, then this is processed
directly by the function Im and the result is returned. In all other cases the
expression Im(expr) is returned.

Use the function rectform  if you have unknowns which represent real or
complex quantifiers (see examples below).

>>  Im( 2*exp(1+I) );

      2 E sin(1)

>>  Im( u+v*I );

      Im(u) + Re(v)

>>  Im( x+Re(2+3*I) );

      Im(x)

>>  rectform( tan(x+I*y),{x,y} );

          sin(2 x)            I sinh(2 y)
      -------------------- + --------------------
      cos(2 x) + cosh(2 y)   cos(2 x) + cosh(2 y)

>>  Im( % );

           sinh(2 y)
      --------------------
      cos(2 x) + cosh(2 y)

See also:  conjugate , funcattr , Re, rectform

