# Evaluating this double integral numerically using NIntegrate [closed]

I want to obtain $I$ as a function of $V$, in the following equation

$I = \int\limits_0^\infty\int\limits_0^\infty \left(\frac{1}{1 + e^{x+y}}\right) \left(\frac{1}{e^{V-x-y}+1}\right) \left(\frac{1}{\sqrt{y}}\right) dy\ dx$

I want to numerically evaluate the integral so as to get a curve of $I$ versus $V$.

I used the following commands

f[v_] :=
NIntegrate[
(1/(1 + Exp[x + y])) (1/(Exp[v - x - y] + 1)) (1/Sqrt[y]),
{y, 0, 1000000}, {x, 0, 1000000}]

Plot[f[v], {v, 0, 1}]


It gives me the error message:

NIntegrate::izero: Integral and error estimates are 0 on all integration subregions. Try increasing the value of the MinRecursion option. If value of integral may be 0, specify a finite value for the AccuracyGoal option.

Context - Basically, the integrand is a product of fermi-functions which i am trying to evaluate so as to get current versus voltage relation in a device.

## closed as off-topic by Anton Antonov, Henrik Schumacher, José Antonio Díaz Navas, MarcoB, SektorApr 12 '18 at 18:20

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Anton Antonov, Henrik Schumacher, José Antonio Díaz Navas, MarcoB, Sektor
If this question can be reworded to fit the rules in the help center, please edit the question.

• 1. Use SetDelayed[] (:=) instead of Set[] (=) when defining your function. 2. Reduce your function to a single NIntegrate[]. Thus: f[v_] := NIntegrate[(1/(1 + Exp[x + y])) (1/(1 + Exp[v - x - y])) (1/Sqrt[y]), {x, 0, ∞}, {y, 0, ∞}] Alternatively: f[v_] := NIntegrate[LogisticSigmoid[x + y - v] LogisticSigmoid[-x - y]/Sqrt[y], {x, 0, ∞}, {y, 0, ∞}] – J. M. will be back soon Mar 7 '18 at 21:34
• For comparison, the exact integral can be evaluated for v == 0, i.e, Integrate[ (1/(1 + Exp[x + y])) (1/(Exp[-x - y] + 1)) (1/Sqrt[y]), {y, 0, Infinity}, {x, 0, Infinity}] evaluates to (-(-1 + Sqrt[2]))*Sqrt[Pi]*Zeta[1/2] or 1.072154929940191 – Bob Hanlon Mar 8 '18 at 0:42

One can do the x integral analytically:

g[v_] = Integrate[
(1/(1+Exp[x+y])) (1/(Exp[v-x-y]+1)) (1/Sqrt[y]),
{x, 0, Infinity},
Assumptions -> y>0 && v>0
]


Log[(E^v + E^y)/(1 + E^y)]/((-1 + E^v) Sqrt[y])

Using the above we can define:

f[v_] := NIntegrate[g[v], {y, 0, Infinity}]


Visualization:

Plot[f[v], {v, 0, 1}]


• The answer given by a single NIntegrate and your method have orders of magnitude difference. – Indeterminate Mar 7 '18 at 23:35
• @JashanSinghal You should give an example v that demonstrates your claim. Perhaps the issue is that you chose to use 1000000 as an upper limit instead of Infinity. – Carl Woll Mar 7 '18 at 23:52

Direct numerical solution is

f[v_?NumericQ] :=NIntegrate[(1/(1 + Exp[x + y])) (1/(Exp[v - x - y] + 1)) (1/Sqrt[y]), {y, 0, Infinity}, {x, 0, Infinity}]

Plot[f[v], {v, 0, 1}]