Calculate Real Part of Expression in Mathematica

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

The forum discussion focuses on calculating the real part of a complex expression in Mathematica. The user initially encounters issues with the Re function due to improper syntax, including a rogue square bracket and incorrect representation of the imaginary unit. Solutions provided include correcting the imaginary unit to a capital "I" and using the ComplexExpand function to ensure that the variable x is treated as real. These adjustments lead to successful computation of the real part of the expression.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of complex numbers and their representation in programming
  • Knowledge of the Log function in Mathematica
  • Experience with symbolic computation techniques in Mathematica
NEXT STEPS
  • Learn how to use ComplexExpand in Mathematica for symbolic computations
  • Explore the proper usage of the Log function with complex arguments in Mathematica
  • Study the representation of complex numbers in Mathematica, including the use of "I"
  • Investigate error handling and debugging techniques in Mathematica code
USEFUL FOR

Mathematica users, mathematicians, and anyone working with complex numbers and symbolic computations in programming.

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
2K
  • · 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 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K