0

Let's say that $x$ is some real valued number $>0$.
Are the following commands interchangeable in the context of using Assuming?

  1. Assuming[{Re[x] > 0}, Integrate[...,x]]
  2. Assuming[{x ∈ Reals && x > 0}, Integrate[...,x]]

Or, as I suspect, is this not true for the reason that Re[x] > 0 should just mean that the Real component of $x$ is $>0$? Also, is there a way to more compactly specify {x ∈ Reals && x > 0}?

Artes
  • 57,212
  • 12
  • 157
  • 245
user11959
  • 3
  • 1

1 Answers1

2

No. Re[x] > 0 means that the real part of x is positive, but it does not mean that the imaginary part is zero. Re[1+I] > 0 but 1+I is not real.

However, x > 0 is sufficient and (in Mathematica) implies that x is also real.

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
  • Thanks, I just saw some strange behavior for ConditionalExpression and it made me wonder, so I'll think more carefully about my integral. I'll accept your answer after the timer allows me to. – user11959 Jan 26 '14 at 01:15
  • "However, x > 0 is sufficient and (in Mathematica) implies that x is also real." Hmm, I'm wondering if this is a little dangerous? – user11959 Jan 26 '14 at 01:16
  • @user11959 How is it dangerous? – Mr.Wizard Jan 26 '14 at 01:18
  • @Mr.Wizard Well, $0$ lies on the imaginary axis as well, so someone who just assumes that the magnitude of some variable is non-zero might write that down, and provide the wrong set of assumptions for an integral (ignoring the possibility of an imaginary component). – user11959 Jan 26 '14 at 01:20
  • @Mr.Wizard I shouldn't say "dangerous", since I don't mean anything outside the context of this assumption being confusing. I suppose you'd have to write $Norm[x]>0$ as an assumption to not to have this happen. – user11959 Jan 26 '14 at 01:23
  • 1
    @user11959 Not Norm, but Abs, in this case. The idea is that comparisons don't make sense for complex number. As soon as you use a comparison, Mathematica assumed that the associated variable is real. Yes, this is a peculiarity of Mathematica that you need to be aware of and not something immediately obvious. – Szabolcs Jan 26 '14 at 01:24
  • 1
    @Szabolcs I can see why it makes sense, but I'm glad to have been explicitly told about it all the same, thanks for that. – user11959 Jan 26 '14 at 01:27
  • @user11959 Regarding seeing Re[z]>0 in ConditionalExpressions, that means exactly that the real part is greater than zero, not that the imaginary part is zero. There's nothing weird about it. Example: Integrate[Exp[-z x], {x, 0, \[Infinity]}]. Mathematica assumes z to be complex here because I didn't explicitly tell it that it's real. – Szabolcs Jan 26 '14 at 01:33
  • In general x > a implies that x ∈ Reals. However there might appear some problems. The main problem comes from the fact that various functions involve some internal bugs. I recommend reading carefully this answer Issue with NSolve. – Artes Jan 26 '14 at 01:34
  • @Szabolcs What I meant about the strange behavior with ConditionalExpression was that the presented solution should not have been defined on the complex plane, so I thought Re[x]>0 was somehow compressing the statement "x must be real and >0". However, it appears I could have been mistaken about the solution. – user11959 Jan 26 '14 at 01:36
  • @Artes I enjoyed reading your answer quite a bit. I wonder if your insight regarding Solve vs. NSolve applies also to indefinite vs. definite integration? – user11959 Jan 26 '14 at 01:40
  • @user11959 Especially one should be careful working with Integrate since it is well known that there are various bugs and there are many posts describing them e.g. Mathematica 9 can't integrate this function but earlier versions could. It doesn't relate to definite vs. indefinite integration. – Artes Jan 26 '14 at 01:50