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

Please Help Mathematica ignoring variable domains

  1. Oct 14, 2009 #1
    Please Help!! Mathematica ignoring variable domains

    I had to calculate an integral, which involves real as well complex parts. As mathematica takes all variables to be complex by default I used the elements function to define that certain variables were Reals.

    But it doesn't change the answer. It is still giving a long answer with the same conditions as if the variables were complex.

    I am attaching a PDF file if anyone wants to have a look. Am i doing something wrong??

    Attached Files:

  2. jcsd
  3. Oct 14, 2009 #2
    Re: Please Help!! Mathematica ignoring variable domains

    First off

    Code (Text):

    Elements[q, q', Reals]
    Isn't a valid command (unless you have defined it elsewhere), you need to use Element[q,Reals]; Element[q',Reals];

    Secondly you might want to try doing the integral with the assumptions option

    Code (Text):

    Integrate[f1,{k,-1,1},Assumptions->{Element[q,Reals] && Element[q',Reals] && ...}]
    for each of the elements you are assuming for.

    Third: your problem isn't just that they are treated as complex numbers, but that the real/imaginary part of those numbers have specific constraints as well. you may need to provide a whole list of assumptions to get a nice output.

    Additionally, mathematica does NOT always treat subscripted variables as symbols unless you have specifically delcared them as symbolboxes with the Symbolize command. so it could be that some of the subscripted variables are not being treated correctly. Its still a bit of a mystery as to when mathematica decides to automatically declare a symbolbox and when it doesn't.

    Finally, mathematica has terrible symbolics for things beyond very simple manipulations. It may be that you are asking too much of it here. See if you can work out any substiutions by hand to simplify the problem.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook