Mathematica Real Part in Mathematica: How to Extract the Real Values from Fractions

  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
The discussion revolves around a user seeking assistance with Mathematica to extract the real part of a fraction involving real variables and imaginary units. Initially, the user reports that using the Re[] function yields no useful results. Suggestions include using the ComplexExpand function, which is confirmed to eliminate imaginary components from the output. The user expresses confusion regarding the presence of imaginary units in their expression, but after clarification, acknowledges that ComplexExpand effectively provides the desired real component without any imaginary numbers. The conversation highlights the importance of understanding built-in functions in Mathematica for simplifying complex expressions.
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
Can you post the code?
 
Screen Shot 2018-02-24 at 5.59.52 PM.png
 

Attachments

  • Screen Shot 2018-02-24 at 5.59.52 PM.png
    Screen Shot 2018-02-24 at 5.59.52 PM.png
    14.4 KB · Views: 578
Last line is output
 
Looks fine to me. Apparently the expression doesn’t simplify much
 
You could try using ComplexExpand:
MM.png
 

Attachments

  • MM.png
    MM.png
    2.7 KB · Views: 1,043
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 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!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K