Group Abstract Group Abstract

Message Boards Message Boards

Get the Real part of a complex function with ComplexExpand and Re?

Posted 7 years ago
Attachment

Attachments:
POSTED BY: Daniel Voloshin
3 Replies
Posted 7 years ago

This is just to illustrate, in code, Gianlucas and Murrays earlier replies:

In[1]:= r[w_] := 200/(I w (10 I w + 1))

In[2]:= t = r[q]
Out[2]= -((200 I)/((1 + 10 I q) q))

In[3]:= ComplexExpand@Re@t
Out[3]= -(2000/(1 + 100 q^2))
POSTED BY: Hans Milton

P.S. You may want your original definition to use a "patterned" variable on the left-hand side — either

 r[w_] := 200/(I w(10I w + 1))

or

 r[w_] = 200/(I w(10I w + 1))

Note also that there is utterly no need for those distracting * symbols between items of a product; just a space between symbols in a product is enough, and when the first of two items in the product is an actual number, you don't even need a space there. Almost like in printed or handwritten math! The * symbol to denote multiplication is a relic from Fortran and other programming languages as well as from early, dumb "computer-assisted algebra" systems.

POSTED BY: Murray Eisenberg

You answered yourself: ComplexExpand is made precisely for that purpose:

ComplexExpand[ReIm[r[w]]]

I don't know why Simplify does not do the job automatically in your example.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard