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

  • Context: Mathematica 
  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around extracting the real part of a fraction containing complex variables in Mathematica. Participants explore methods to achieve this, particularly focusing on the use of built-in functions and simplification techniques.

Discussion Character

  • Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant expresses difficulty in obtaining the real part of a fraction using the Re[] function in Mathematica, noting that it simply echoes the input.
  • Another participant requests to see the code to better understand the issue.
  • A participant suggests using ComplexExpand as a potential solution for extracting the real component.
  • A later reply indicates that ComplexExpand should work, as it eliminates imaginary components from the final answer.
  • One participant clarifies their intent to obtain the real component without any imaginary numbers, suggesting a method involving multiplying by the conjugate.
  • There is a misunderstanding where a participant initially overlooks the absence of imaginary numbers in the output, which is later acknowledged and corrected.

Areas of Agreement / Disagreement

Participants generally agree on the use of ComplexExpand as a method to extract the real part, but there is some confusion about its application and the presence of imaginary components in the output.

Contextual Notes

The discussion includes assumptions about the nature of the variables involved and the specific output expected from Mathematica functions, which may not be fully articulated.

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: 595
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,061
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!
 

Similar threads

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