# Why Mathematica cannot solve this numerical integration?

I am trying to calculate the following integral. But, Mathematica does not output anything...

$\mathcal{L}=\int_0^{\infty}\exp\left\{-\mathbb{E}_h\left[\int_x^{\infty}\left(1-\exp\left(-\mu x^{\alpha}hz^{-\alpha}\right)\right)2\lambda\pi z \text{ d}z\right]\right\}2\lambda\pi x\exp(-\lambda\pi x^2)\text{ d}x$

$\bf{EDIT:}$ The correct form is

$\mathcal{L}=\int_0^{\infty}\exp\left(-2 \pi\lambda \int_x^{\infty}\left(1-\mathbb{E}_h[\exp\left(-\mu x^{\alpha}hz^{-\alpha}\right)]\right)z \text{ d}z\right)2\lambda\pi x\exp(-\lambda\pi x^2)\text{ d}x$

I am doing this....

\[Alpha] = 4;
\[Mu] = 3.1623;
\[Lambda] = 50;

NIntegrate[
Exp[-Expectation[
NIntegrate[(1 -
Exp[-\[Mu]*x^\[Alpha]*h*z^(-\[Alpha])])*2*\[Pi]*\[Lambda]*
z, {z, x, Infinity}],
h \[Distributed] ExponentialDistribution[1]]]*2*\[Pi]*\[Lambda]*
x*Exp[-\[Pi]*\[Lambda]*x^2], {x, 0, Infinity}]


$\bf{EDIT:}$ Now, I am doing this....Is it correct, I am getting 0.252313

 \[Alpha] = 4;
\[Mu] = 3.1623;
\[Lambda] = 50;

NIntegrate[
Exp[-2*\[Pi]*\[Lambda]*
NIntegrate[(1 -
Expectation[Exp[-\[Mu]*x^\[Alpha]*h*z^(-\[Alpha])],
h \[Distributed] ExponentialDistribution[1]])*z, {z, x,
Infinity}]]*2*\[Pi]*\[Lambda]*
x*Exp[-\[Pi]*\[Lambda]*x^2], {x, 0, Infinity}]


We can make progress if we deconstruct the calculation and do as much symbolically as possible. First, we try the innermost integral, as

ClearAll["Global*"]
α = 4;
f = Integrate[
(1 - Exp[-μ*x^α*h*z^(-α)])*2*π*λ*z,
{z, x, Infinity},
Assumptions -> {x > 0, h > 0, μ > 0}]

(* π x^2 λ (-1 + E^(-h μ) +
Sqrt[π] Sqrt[h μ] Erf[Sqrt[h μ]])  *)


Notice that we set the value of α and tell Integrate[] that the other variables are positive, and therefore real.

The next step is to evaluate the Expectation[]. When I see that error function in the result for f, I am not encouraged, but let's try it.

g = Expectation[f, h \[Distributed] ExponentialDistribution[1]]

(* π x^2 λ Sqrt[μ] ArcTan[Sqrt[μ]] *)


Very encouraging. Now we try the numerical integration, as

λ = 50; μ = 3.1623;
NIntegrate[
Exp[-g]*2*π*λ*x*Exp[-π*λ*x^2],
{x, 0, Infinity}]

(* 0.346937 *)


Hopefully, this is the desired solution to the originally stated problem.

For the edited problem, when we try to execute your code, MMA reminds us that there is a non-numerical expression in the integrand of NIntegrate. This is because we are telling the inner NIntegrate to return a function of x. We need to change it to Integrate and add the assumption that x ∈ Reals, as

ClearAll["Global*"]
α = 4;
μ = 3.1623;
λ = 50;

NIntegrate[Exp[-2*π*λ*
Integrate[(1 - Expectation[
Exp[-μ*x^α*h*z^(-α)],
h \[Distributed] ExponentialDistribution[1]])*z,
{z, x, Infinity},
Assumptions -> x ∈ Reals]],
{x, 0, Infinity}]

(*  0.0515386  *)

• Thank you very much. I have edited my question, where I have an alternative form for the same problem. If the two solutions match, then only I will be able to confirm it. Will you please have a look at it and suggest me a way to solve it. – Dimitrios Jan 31 '17 at 7:04
• In an earlier version of my answer I said Evaluate was required, but this was incorrect. I also said the assumption x>0 was required, but this was also wrong. The inner integral can be evaluated with x ∈ Reals. My apologies for the misdirection. – LouisB Jan 31 '17 at 9:18