MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Finding real part (newbie question)


Gnalle <GNALLE at MMF.ruc.dk> writes:

> If a,b,c,d are real numbers. How do I use mathematica to find the real
> part of

> 1/(a + I b + 1/(c + I d))

Try using ComplexExpand or use the standard package Algebra`ReIm.m. With
the definition

RealPart[expr_] := 
 (Cases[expr, z_Symbol :> (z /: Im[z] = 0) , Infinity];
Simplify[Re[expr]])


and expr = 1/(a + I b + 1/(c + I d)), RealPart[expr] gives

                               2      2
                        c + a c  + a d
        -----------------------------------------------
                             2   2    2     2   2    2
        1 + 2 a c - 2 b d + a  (c  + d ) + b  (c  + d )
-- 
_________________________________________________________________________
Levent Kitis                            
lk3a at esmeralda.mech.virginia.edu University of Virginia Department of
Mechanical and Aerospace Engineering
_________________________________________________________________________


  • Prev by Date: Re: Crystal.m package
  • Next by Date: Re: Finding real part (newbie question)
  • Previous by thread: Re: Finding real part (newbie question)
  • Next by thread: Re: Finding real part (newbie question)