I have an integral that needs to be evaluated using NIntegrate: $$\int_0^{10}\mathrm{d}x_1\int_0^{10}\mathrm{d}x_2\left(1+(x_2-x_1)^2\right)^{-1/6}\mathrm{e}^{-\int_0^{x_1}\mathrm{d}x'\int_0^{x_1}\mathrm{d}x''f(x'-x'')-\int_0^{x_2}\mathrm{d}x'\int_0^{x_2}\mathrm{d}x''f(x'-x'')}\times\int_0^{x_1}\mathrm{d}x'\int_0^{x_1}\mathrm{d}x''f(x_1-x')f(x_2-x''),$$ where $$f(x)=\frac{1}{(1+x^2)^{1/3}}.$$
If I follow the instruction given in this link, the computational time it takes is too much. Is there any way to improve the computational time?
Here is the code:
f[x_]:=1/(1+x^2)^(1/3); i1[x1_?NumericQ, x2_?NumericQ] := i1[x1, x2] = NIntegrate[f[z1 - z2], {z1, 0, x1}, {z2, 0, x1}]; i2[x1_?NumericQ, x2_?NumericQ] := i2[x1, x2] = NIntegrate[f[z1 - z2], {z1, 0, x2}, {z2, 0, x2}]; NIntegrate[((1+(x2-x1)^2)^(-1/6)Exp[(i1[x1, x2] + i2[x1, x2])]f[x1-z1]* f[x2-z2], {x1, 0, 10}, {x2, 0, 10},{z1,0,x1},{z2,0,x1}];
f[0,..]? You have unbalanced parenthesis in last expression. If you are trying to use memoization the second:=should just be=$\endgroup$