MathGroup Archive 1999

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

Search the Archive

RE: Real coefficients in complex numbers


Niels Langager Ellegaard  wrote:
_________________________

If you are calculations with complex numbers: a + I b How do you state
that a and b are real? For example I might want to calculate the real
part of

a + 1/(b + 1/(1/I c + d)) ; Where a,b,c,d are real

Can this be done in a nice way. (Yes, I do know how to do the
calculation by hand)

________________________

Use ComplexExpand.

In[1]:=
?ComplexExpand
"ComplexExpand[expr] expands expr assuming that all variables are real.
ComplexExpand[expr, {x1, x2, ... }] expands expr assuming that
variables matching any of the xi are complex."


In[2]:=
Re[a + 1/(b + 1/(1/I c + d))]//ComplexExpand

(* Output not shown *)


Regards,
Ted Ersek


  • Prev by Date: Re: Q: how to list vertices of the Geodesate[] of a polyhedron?
  • Next by Date: NDSolve problem
  • Previous by thread: Real coefficients in complex numbers
  • Next by thread: Re: Real coefficients in complex numbers