Mathematica Calculate Real Part of Expression in Mathematica

  • Thread starter Thread starter bulash
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
To extract the real part of a complex function in Mathematica, the user encountered issues with the syntax and the definition of variables. Initially, the function contained a rogue square bracket, which was corrected. The main challenge was the lack of defining the variable x as real. Suggestions included ensuring the imaginary unit is correctly represented as "I" instead of "i" and using the Mathematica shortcut for the imaginary symbol. Additionally, employing the ComplexExpand function can help obtain a symbolic representation under the assumption that x is real. These adjustments should enable the user to successfully compute the real part of the function.
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

Back
Top