Mathematica ignoring variable domains

In summary, the conversation discusses a problem with Mathematica ignoring variable domains while calculating an integral with both real and complex parts. The user has tried using the elements function and assumptions option, but is still getting a long answer with incorrect conditions. They also mention potential issues with subscripted variables and suggest trying manual substitutions to simplify the problem.
  • #1
elduderino
57
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

  • problematic.pdf
    86.8 KB · Views: 211
Physics news on Phys.org
  • #2


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.
 
  • #3


It is important to note that Mathematica is a powerful computational software and it follows certain rules and assumptions when performing calculations. One of these assumptions is that all variables are complex by default. In order to specify that certain variables are real, the "Assumptions" or "Assuming" function should be used. This will inform Mathematica to take into account the variable domains and provide a more accurate result.

In your case, it seems like you have correctly used the "Assuming" function, but the result is still not what you expected. This could be due to a variety of reasons, such as incorrect syntax or conflicting assumptions. I would recommend checking your code and making sure that all assumptions are consistent and accurately defined. If the issue persists, you can also consult the Mathematica documentation or reach out to the support team for further assistance.
 

1. What does it mean for Mathematica to "ignore variable domains"?

When using Mathematica, you can specify the domain of a variable to restrict its possible values. However, in some cases, you may want Mathematica to ignore this domain and consider all possible values for the variable. This can be useful for solving more complex equations or for exploring different scenarios.

2. How do I make Mathematica ignore variable domains?

To make Mathematica ignore variable domains, you can use the command "Assumptions -> False" in your code. This will tell Mathematica to not take into account any specified domains for the variables in your equations.

3. What are the benefits of ignoring variable domains in Mathematica?

Ignoring variable domains in Mathematica can lead to more general and flexible solutions. It allows for a wider range of possible values for variables, which can be helpful for exploring different scenarios and finding unexpected solutions to problems.

4. Are there any drawbacks to ignoring variable domains in Mathematica?

Ignoring variable domains can also lead to less specific and potentially incorrect solutions. Without the restrictions of a domain, it is possible for Mathematica to give solutions that do not align with the desired results. It is important to carefully consider the use of variable domains when using Mathematica.

5. Can I specify which variables to ignore domains for in Mathematica?

Yes, you can use the command "Assumptions -> {x, y} \[Element] Reals" to specify which variables you want Mathematica to ignore domains for. This will only ignore the domains for the variables x and y, while still considering any other specified domains for other variables in your code.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
5K
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
4K
  • Programming and Computer Science
Replies
1
Views
687
Back
Top