Calculate Real Part of Expression in Mathematica

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

Discussion Overview

The discussion revolves around calculating the real part of a complex expression in Mathematica, specifically involving logarithmic and complex number operations. Participants explore issues related to syntax and variable definitions within the software.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks assistance with extracting the real part of a complex expression but encounters issues with Mathematica returning the original input instead.
  • Another participant points out a syntax error involving a misplaced square bracket in the logarithm function.
  • A participant acknowledges the syntax error and suggests that the real issue may be the lack of a definition for the variable x as real.
  • Another suggestion includes correcting the representation of the imaginary unit from "i" to "I" or using a specific Mathematica input method for the imaginary number.
  • One participant proposes using the ComplexExpand function to obtain a symbolic representation under the assumption that x is real.

Areas of Agreement / Disagreement

Participants generally agree on the presence of syntax errors and the need for proper definitions in Mathematica, but there is no consensus on the best approach to resolve the original problem.

Contextual Notes

Limitations include the assumption that x is real, which has not been explicitly defined in the original expression. The discussion also highlights potential syntax issues that may affect the execution of the code.

bulash
Messages
4
Reaction score
0
Dear all,

I try to get the Real part of the following function in Mathematica:

Code:
(-0.0006451572617131402 + 0.01297637024965604i)*
Log[(1.3104275557173537 - 1.368518505178231i]) + x]


by using Re[z]. However, it gives no solution other than just repetition of what I entered:


Code:
Re[(-0.0006451572617131402 + 0.01297637024965604i)*
Log[(1.3104275557173537 - 1.368518505178231i]) + x]]


Any suggestions? Thanks in advance.

bulash.
 
Physics news on Phys.org
You have a rogue square bracket in your logarithm.
 
OK. Right, thank you.

It was my "copy-paste fault". Must be like that:

Code:
(-0.0006451572617131402 + 0.01297637024965604i)*
Log[(1.3104275557173537 - 1.368518505178231i) + x]

The problem is, I think, the lack of definition of x as real. But how? tried almost every way, no way? :(

B.
 
You have written the imaginary symbol "i" wrongly in your code. Replace it with a capital "I" or alternatively use the mathematica symbol for an imaginary number, which you can get by typing Esc, ii, Esc (Esc is the button Esc on the keyboard).

Try either method and you should get the code to work.
 
Also, you can use ComplexExpand to get a symbolic representation assuming that x is real.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K