MathGroup Archive 1999

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

Search the Archive

Re: Finding real part (newbie question)


Gnalle <GNALLE at MMF.ruc.dk> schrieb:
> 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))
> 
> Yes I can calculate it by hand, but I would like to know how to use
> Mathematica.

Try this:

z=1/(a + I b + 1/(c + I d)

this gives the real-part:

In[1]=
z1=ComplexExpand[z,TargetFunctions->{Re,Im}]//.Complex[0,_]->0
//Simplify

Out[1]=
               c + a c^2 + a d^2
-------------------------------------------------- 
1 + 2 a c - 2 b d + a^2(c^2 + d^2) + b^2(c^2 + d^2)

The imaginary part is then z-z1.

es gruesst
      Peter
-- 
=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=
  Peter Breitfeld, Saulgau, Germany       (PGP public key: 08548045)


  • Prev by Date: List manipulation question
  • Next by Date: Notebook -> Kernel
  • Previous by thread: Re: Finding real part (newbie question)
  • Next by thread: Crystal.m package