Backslide introduced in v10 and persisting through v10.3.1.
Consider the following integral
AbsoluteTiming[
Integrate[k^(n) SphericalBesselJ[l, R*k], {k, 0, ∞},
Assumptions -> {l > 0, R > 0}]]
On my machine Mathematica 10.3.1 (Linux version) can do it in roughly 20 seconds
{19.7088,
ConditionalExpression[(
Sqrt[π] 2^(n - 1) R^(-n - 1) Gamma[1/2 (l + n + 1)])/Gamma[
1/2 (l - n + 2)], Re(n) < 1 ∧ l + Re(n) > -1]}
Since for my purpose n
is an integer, one would think that specifying this condition in the assumptions will make it easier for Mathematica to solve the integral. Right? Apparently not! For
AbsoluteTiming[
Integrate[k^(n) SphericalBesselJ[l, R*k], {k, 0, ∞},
Assumptions -> {l > 0, R > 0, n ∈ Integers}]]
I obtained
{69.0534,
Integrate[k^n SphericalBesselJ[l,k R], {k, 0, ∞},
Assumptions -> {l > 0, R > 0, n ∈ \!\(\*
TagBox["\[DoubleStruckCapitalZ]", Function[{}, Integers]]\)}]}
i.e. now Mathematica failed to solve my integral. Is this a bug or I'm missing something about Assumptions
for symbolic integration?
EDIT (3.01.2016): According to WRI this is not a bug/backslide but merely a timing issue. As pointed out by @bbgodfrey, one can avoid this behavior by using Integrate
together with TimeConstrained
.