Why does Re[] not simplify a fraction with imaginary units in Mathematica?

  • Topic: Mathematica 
  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Mathematica
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
8 replies · 3K views · last reply
member 428835
Hi PF!

I have some variables that are all real, and I have a few ##i##s, all in a fraction. When I ask Mathematica to give me the real part of the entire fraction, ##Re[]##, it simply echoes my input, not giving me anything useful. Any help is greatly appreciated.
 
Physics news on Phys.org
Mathematica notebook showing sigma = (1 + t (1 - theta) (I lambda_i + lambda_r)) / (1 - t theta (I lambda_i + lambda_r)), then Element[{t, theta, lambda_i, lambda_r}, Reals], then Re[sigma] // FullSimplify, whose output is 1 - Re[(1 + 1/(-1 + t theta (i lambda_i + lambda_r))/theta].
 
Attachments
  • Mathematica notebook showing sigma = (1 + t (1 - theta) (I lambda_i + lambda_r)) / (1 - t theta (I lambda_i + lambda_r)), then Element[{t, theta, lambda_i, lambda_r}, Reals], then Re[sigma] // FullSimplify, whose output is 1 - Re[(1 + 1/(-1 + t theta (i lambda_i + lambda_r))/theta].
    Screen Shot 2018-02-24 at 5.59.52 PM.png
    14.4 KB · Views: 618
You could try using ComplexExpand:
Mathematica session: In[5] defines sigma as a fraction with complex terms using lambda i and lambda r; Out[5] shows the simplified form. In[6] applies ComplexExpand[Re[sigma]] // PowerSimplify, Out[6] shows a real-part fraction in lambda r, lambda i and theta.
 
Attachments
  • Mathematica session: In[5] defines sigma as a fraction with complex terms using lambda i and lambda r; Out[5] shows the simplified form. In[6] applies ComplexExpand[Re[sigma]] // PowerSimplify, Out[6] shows a real-part fraction in lambda r, lambda i and theta.
    MM.png
    2.7 KB · Views: 1,081
phyzguy said:
You could try using ComplexExpand:
View attachment 221008
Yea I've tried this before. I should have been more specific: see what I want is the real component without any imaginary numbers. Like multiplying by the conjugate and simplifying. Do you know if there a built in function that does this?
 
joshmccraney said:
Yea I've tried this before. I should have been more specific: see what I want is the real component without any imaginary numbers. Like multiplying by the conjugate and simplifying. Do you know if there a built in function that does this?

Look again at my post. That's what ComplexExpand does. There are no "i's" in the final answer.
 
  • Like
Likes   Reactions: member 428835
phyzguy said:
Look again at my post. That's what ComplexExpand does. There are no "i's" in the final answer.
Ohhhhh shooot, sorry! I saw the variable ##\lambda i## and thought there was an ##i## in the solution. Sorry and thanks!