       Re: Forcing Re[]'s to be Real

• To: mathgroup at smc.vnet.net
• Subject: [mg18239] Re: Forcing Re[]'s to be Real
• From: "David Keith" <dkeith at sarif.com>
• Date: Thu, 24 Jun 1999 14:24:20 -0400
• Organization: Hevanet Communications
• References: <7kpbj1\$4b8@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Hi Anthony,

Two things I think:

2) Re[] doesn't seem to want to approximate the exact number Sqrt[Complex],
but Re[Complex]//N ans Re[ApproximateComplex] works fine. Since plot uses
N[] it seems to work fine also.

Dave

See below:

In:=
k[w_] := Sqrt[w^2 (1 + (2 / (1 + I w)))]

In:=
Re[k]

Out=
\!\(Re[\ at \(2 - \[ImaginaryI]\)]\)

In:=
Re[k[1.]]

Out=
1.45535

In:=
Re[k] // N

Out=
1.45535

In:=
Im[k] // N

Out=
-0.343561

Plot[{Re[k[x]], Im[k[x]]}, {x, -5, 5}]

Anthony Foglia wrote in message <7kpbj1\$4b8 at smc.vnet.net>...
> I seem to have found an interesting problem involving computing the
>real part of complex numbers.  (Interesting, in that it wasn't there a few
>weeks ago when I ran the (as-far-as-i-can-remember) exact same code.)
>
>I have a complex function:
>
>k[w] := Sqrt[w^2 (1 + (2 / (1 + I w)))]
>
>I want to graph the real and imaginary parts, but Mathematica doesn't want
>to express the Re[k[w]] as a real number.  What do I mean?  Well, if I
>type:
>
>Re[Sqrt[1+I]]
>
>I get out
>
>Re[Sqrt[1+I]]
>
>Same if I do Re[ComplexExpand[Sqrt[1+I]]], or Re[(1+I)^(1/2)].  But if I
>enter:
>
>Re[ComplexExpand[(1+I)^(1/2)]
>
>Mathematica is kind enough to respond with:
>
>2^(1/4) Cos[Pi/8]
>
>I'm certain that this is the root of my problem, but I'll be damned if I
>know why Mathematica doesn't like it now, but did a few weeks ago.  Any
>help?
>
>--Anthony
>

```

• Prev by Date: Re: Forcing Re[]'s to be Real
• Next by Date: Re: Moving average type process
• Previous by thread: Re: Forcing Re[]'s to be Real
• Next by thread: Re: Forcing Re[]'s to be Real