0
$\begingroup$

After running the following code I get an error that simple integrals are not converging. I make a false assumption that e>0, and proceed to evaluate the integral over e. Mathematica doesn't acknowledge the false assumption but strangely asserts that the integral diverges. The same error occurs if I integrate over e.{1,0,0}.

Aslo, when I now evaluate the same integral over a different variable, it gives the same error. Is this a bug?

enter image description here

$\endgroup$
8
  • 2
    $\begingroup$ I am not able to reproduce the issue - see screenshot. I am using version 12 on a mac. However, the hint is that when you reset the kernel everything is fine. Which means, that x and the other variables you used were probably defined previously and leading to peculiar situations $\endgroup$
    – bmf
    Jan 5, 2023 at 9:52
  • 2
    $\begingroup$ Also, in the future, please refrain from using the bugs tag before receiving confirmation that is indeed a bug. You can, of course, use it on the title and say that you suspect a bug, but the tag is reserved for confirmed cases. This is the standard guideline for maintenance reasons :-) $\endgroup$
    – bmf
    Jan 5, 2023 at 9:57
  • 2
    $\begingroup$ Can you reproduce the issue? If yes, can you share the reproduction steps? Otherwise, it will be very difficult to help $\endgroup$
    – Lukas Lang
    Jan 5, 2023 at 10:03
  • $\begingroup$ It is very difficult for me to do so, this occurred after about 2 pages of code. However, it seems to happen when I initiate with the assumption that x>0, and doesn't happen without this assumption. I will try and simplify down to something reasonable. $\endgroup$
    – Matt Majic
    Jan 5, 2023 at 10:32
  • 1
    $\begingroup$ @MattMajic please make sure that after two pages of coding, x is clear and not pre-difned. If it's clear, it should be blue when you type x and in the expression Integrate[Cos[x], {x, 0, Pi}] it should be something between green and blue. Let's call it green/blue. $\endgroup$
    – bmf
    Jan 5, 2023 at 10:36

1 Answer 1

2
$\begingroup$

This is the solution I think to the situation. I am attaching a screenshot; see below

screen

Observe that the problem arose when the condition was e > 0 but the two elements of the list were zero; please see below

final

$\endgroup$
10
  • 2
    $\begingroup$ While the exact error message is strange, it's not really surprising that something breaks if you provide assumptions that are effectively false (anything can be proven if you start with wrong assumptions). Honestly, I am surprised that e>=0 works at all since comparison operators are not listable in Mathematica (so {1,2}>0 doesn't evaluate to anything) $\endgroup$
    – Lukas Lang
    Jan 5, 2023 at 12:15
  • 1
    $\begingroup$ @LukasLang, when giving assumptions, many operators actually become "listable" (because you can provide the same assumption for many variables), for example: Simplify[Re[a] + Re[b], Assumptions -> {a, b} > 0] or Simplify[Re[a] + Re[b], Assumptions -> {a, b} \[Element] Reals] both work as expected. $\endgroup$
    – Domen
    Jan 5, 2023 at 12:18
  • $\begingroup$ @LukasLang I agree that it is strange as a message, but the point is that caution is needed and also see the comment made by Domen $\endgroup$
    – bmf
    Jan 5, 2023 at 12:22
  • $\begingroup$ In addition to what @Domen wrote please also have a look at GreaterThan[0] /@ {1, 2} for general purposes :-) $\endgroup$
    – bmf
    Jan 5, 2023 at 12:23
  • 3
    $\begingroup$ A side note: giving false assumptions does generate a warning, for example: $Assumptions = 0 > 0. However, when a "combined" assumption is given, such as $Assumptions = {0, 0} > 0, there is no warning because the assumptions are not evaluated until needed (in Integrate or some other function). $\endgroup$
    – Domen
    Jan 6, 2023 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.