Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica:How can I acclaim a variable is real in a complex function

  1. Feb 17, 2009 #1
    Hi,I'm a beginner.
    here's the example:
    f[x_] := E^(I*x)
    I'd like get 1,but it give me a complex function coz it regard x as complex.
    please help me:how to claim x is real?

    by the way,is that necessary to define a letter as a constant.no matter yes or not,how to refer a letter constant to be real or pure imaginary

    Thank you!
    Last edited: Feb 17, 2009
  2. jcsd
  3. Feb 17, 2009 #2


    User Avatar
    Science Advisor
    Homework Helper

    You could do
    Code (Text):
    so it takes only the real part of x (which doesn't change it, of course, when x is real).
  4. Feb 18, 2009 #3
    Thanks for your reply.
    I tried your answer,and it works.

    Well,I have some...eerr...
    what if I'd define the domain for function f[x]?
    I mean that I wanna prescribe x in f[x] must be real or pure imaginary or rational number.How to do that.

    I've a similar question here.How to claim a letter constant to be real or pure imaginary or rational number?

    Waiting for your kindness.
    Last edited: Feb 18, 2009
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Similar Threads for Mathematica acclaim variable
Mathematica Storing Mathematica output
Mathematica Mathematica to MATLAB
Mathematica Cannot do the integral of the Hyper-geometric function?
Mathematica Cannot Plot This Function in Mathematica
Mathematica While Loop in Mathematica