# Getting an error with NIntegrate due to insufficient WorkingPrecision or divergent integral

Hello I have the following problem. But when I try to solve it, I get an error saying 'Catastrophic loss of precision in the global error estimate due to \ insufficient WorkingPrecision or divergent integral'

How can I resolve this? Increasing the WorkingPrecision does not help. Note that when I change the value of $\mu$ to 6.3096 it works.

α = 3;
δ = 2/α;

LI = Exp[-Expectation[
Integrate[(1 - Exp[-x*h*r^(-1/δ)])*km*λ*π, {r,
A, Infinity}, GenerateConditions -> False],
h \[Distributed] ExponentialDistribution[1],
Assumptions -> {A > 0, km > 0,
r > 0, λ >
0, {A, km, r, λ, α} ∈ Reals}]];

x = s*Ps;
A = r;
M = LI;

s = μ*r^α/Ps;
B = M;

λ = 20;
km = 0.5;
Ps = 0.2;
μ = 5.0119;

AverageProbSuccess =
Assuming[{λ > 0, km > 0,
Ps > 0, μ > 0, {km, Ps, λ, μ} ∈ Reals},
NIntegrate[
B*2*Gamma[λ + 1]/Gamma[λ]*
r*(1 - r^2)^(-1 + λ), {r, 0, Infinity}]]


α = 3;
δ = 2/α;

int = Assuming[{A > 0, km > 0, r > 0, λ > 0},
Integrate[(1 - Exp[-x*h*r^(-1/δ)])*km*λ*π, {r, A,
Infinity}, GenerateConditions -> False]];


The condition suppressed by use of GenerateConditions -> False is Re[h x] > 0, so include assumption that x > 0 and FullSimplify (this is quite slow) the expression for LI with the assumptions.

LI = Assuming[{A > 0, km > 0, r > 0, λ > 0, α ∈ Reals,
x > 0},
Exp[-Expectation[int, h \[Distributed] ExponentialDistribution[1]]] //
FullSimplify];

x = s*Ps;
A = r;
M = LI;

s = μ*r^α/Ps;
B = M;

λ = 20;
km = 1/2;
Ps = 1/5;
μ = 5.0119;

AverageProbSuccess[B_, λ_] :=
NIntegrate[
B*2*Gamma[λ + 1]/Gamma[λ]*r*(1 - r^2)^(-1 + λ), {r,
0, Infinity}]

AverageProbSuccess[B, λ]

(*  0.167891  *)

• Thank you very much. Its working fine! – Srestha Narayanan Apr 12 '16 at 1:43