Mathematica  Mathematica ignoring variable domains

Click For Summary
Mathematica defaults to treating variables as complex, which can lead to unexpected results when calculating integrals involving real variables. To correctly define variable domains, use the command Element[q, Reals] instead of Elements[q, q', Reals]. It's important to apply the Assumptions option in the Integrate function to specify the domains for each variable. Additionally, subscripted variables may not be recognized as symbols unless declared with the Symbolize command, complicating the calculations. For complex problems, manual substitutions may be necessary, as Mathematica struggles with advanced symbolic manipulations.
elduderino
Messages
56
Reaction score
0
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??
 

Attachments

Physics news on Phys.org


First off

Code:
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:
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.
 

Similar threads

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