I've got an $Assumptions variable that I'd like to apply to my whole notebook, looking like so at the moment:
$Assumptions = a > 0 && a ∈ Reals && m > 0 && m ∈ Reals ;
I've actually got a number of variables, and would like to treat all of them as Real and greater than zero. Is there a way to apply such assumptions in batch for a set of variables?
EDIT: comments suggested that only the > checks were required, and that {a,m} > 0 can be used. The greater comment appears to be true, but the set greater than doesn't appear to work:
ClearAll[ a, m, x, psi] ;
psi[x_, a_] = E^(-x^2/2/a^2) / Sqrt[ a Sqrt[Pi]] ;
$Assumptions = a > 0 && a ∈ Reals ;
Integrate[ psi[x, a]^2, {x, -Infinity, Infinity}]
$Assumptions = a > 0 ;
Integrate[ psi[x, a]^2, {x, -Infinity, Infinity}]
$Assumptions = {a, m} > 0 ;
Integrate[ psi[x, a]^2, {x, -Infinity, Infinity}] // Simplify
Integrate[psi[x, a]^2, {x, -Infinity, Infinity}] // FullSimplify
(This gives 1,1, Abs[a]/a, and 1/Sign[a] respectively).
So the question is reduced to how to list a set of variables in Assumptions so that all of them are > 0 (without writing a > 0 && b > 0 && c > 0 && ...
).
a > 0
already impliesa ∈ Reals
, so you only have to include the former assumption. $\endgroup$//Simplify
after each operation and you are there. Have fun! $\endgroup$1
for all. Which version are you using? Also, tryThread[{a,m}>0]
or evenAnd@@Thread[{a,m}>0]
as a workaround. $\endgroup$