Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Finding the real part of a symbolic complex expression

1,287 views
Skip to first unread message

Jacare Omoplata

unread,
May 20, 2012, 2:36:58 AM5/20/12
to
I wanted to find the real part of (a + I b)(c + I d) , assuming a,b,c and d are real, "I" being Sqrt[-1].

So I tried,

Re[(a + I b) (c + I d)] /. Assuming -> Element[{a, b, c, d}, Reals]

Nothing happens. What I get for output is,

Re[(a+I b) (c+I d)]

I found out that I can use the function "ComplexExpand" to expand the expression assuming a,b,c and d to be real. But I'm curious to know if there a way to make Mathematica use "Re" to find the real part?

Nasser M. Abbasi

unread,
May 21, 2012, 5:56:33 AM5/21/12
to
--------------------
expr=(a+I b)(c+I d);
ComplexExpand[Re[expr]]
----------------------
Out[12]= a c-b d

-----------------------------
Assuming[{Element[{a,b,c,d},Reals]},Simplify[Re[Expand[expr]]]]
-----------------------------
Out[15]= a c-b d

--Nasser

Bob Hanlon

unread,
May 21, 2012, 5:58:36 AM5/21/12
to
expr = (a + I b) (c + I d);

Simplify[Re[expr] // ExpandAll, Element[{a, b, c, d}, Reals]]

a c - b d

Re[expr] // ComplexExpand

a c - b d


Bob Hanlon

DC

unread,
May 21, 2012, 5:59:37 AM5/21/12
to
This works for instance :

Simplify[Re[(a + I b) (c + I d) // Expand], Assumptions -> Element[{a, b, c, d}, Reals]]

Murray Eisenberg

unread,
May 21, 2012, 6:00:08 AM5/21/12
to
As you discovered, the way to handle this is with ComplexExpand:

ComplexExpand[Re[(a + I b) (c + I d)]]

a c - b d

Clearly the function Re does not recognize such an Assuming expression.
What one might expect is that the following would work:

Simplify[Re[(a + I b) (c + I d)], Element[{a, b, c, d}, Reals]]

Alas, it simply doesn't. However, the following does:

Simplify[Re[Expand[(a + I b) (c + I d)]],
Element[{a, b, c, d}, Reals]]


On 5/20/12 2:35 AM, Jacare Omoplata wrote:
> I wanted to find the real part of (a + I b)(c + I d) , assuming a,b,c and d are real, "I" being Sqrt[-1].
>
> So I tried,
>
> Re[(a + I b) (c + I d)] /. Assuming -> Element[{a, b, c, d}, Reals]
>
> Nothing happens. What I get for output is,
>
> Re[(a+I b) (c+I d)]
>
> I found out that I can use the function "ComplexExpand" to expand the expression assuming a,b,c and d to be real. But I'm curious to know if there a way to make Mathematica use "Re" to find the real part?
>

--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305

0 new messages