This is mathematica code for my integration,
NIntegrate[((8 - 8 I) x y (1 + x^2 + y^2) ((3 + 4 I) + (2 + 4 I) x^2 -
x^4 - 2 ((1 + 2 I) + x^2) y^2 +
3 y^4))/(\[Pi] (-((-2 - I) + x)^2 + y^2) (-((2 + I) + x)^2 +
y^2) ((1 + x^2)^2 - 2 (-1 + x^2) y^2 + y^4)^2), {y, 0,
Infinity}, {x, -Infinity, 0}]
where the denominator has some poles which have imaginary part. The code gives an error result,
-94.2449 - 98.463 I
and the error messages are
NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.
NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 18 recursive bisections in y near {y,x} = {3008.02,-3007.26}. NIntegrate obtained -94.2449-98.463 I and 26.019110660515846` for the integral and error estimates.
Then I try increase MaxRecursion
NIntegrate[((8 - 8 I) x y (1 + x^2 + y^2) ((3 + 4 I) + (2 + 4 I) x^2 -
x^4 - 2 ((1 + 2 I) + x^2) y^2 +
3 y^4))/(\[Pi] (-((-2 - I) + x)^2 + y^2) (-((2 + I) + x)^2 +
y^2) ((1 + x^2)^2 - 2 (-1 + x^2) y^2 + y^4)^2), {y, 0,
Infinity}, {x, -Infinity, 0}, MaxRecursion -> 40]
But it doesn't improve.
66.4382 + 68.1894 I
and the messages are
NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.
NIntegrate::eincr: The global error of the strategy GlobalAdaptive has increased more than 2000 times. The global error is expected to decrease monotonically after a number of integrand evaluations. Suspect one of the following: the working precision is insufficient for the specified precision goal; the integrand is highly oscillatory or it is not a (piecewise) smooth function; or the true value of the integral is 0. Increasing the value of the GlobalAdaptive option MaxErrorIncreases might lead to a convergent numerical integration. NIntegrate obtained 66.4382 +68.1894 I and 204.94038847839664` for the integral and error estimates.
Finally, I include some poles in the integration range, but it does not help. So my questions are
- how to get the correct answer of this integration?
- Are there any general methods to solve Multiple integrals which have poles with Mathematica?
Update
I think the integration will be inefficient near the poles. Here I try another example,
myf[x_, y_] := (
8 x y (1 + x^2 + y^2) (-(1 + x^2)^2 - 2 (-1 + x^2) y^2 +
3 y^4))/(\[Pi] ((1 + x^2)^2 - 2 (-1 + x^2) y^2 + y^4)^3)
NIntegrate[myf[x, y], {x, -Infinity, 0}, {y, 0, Infinity}]
It also gives the bad result
out:-105.399
But this function can be integrated analytically
Integrate[myf[x, y], {x, -Infinity, 0}]
out:ConditionalExpression[(
2 y)/(\[Pi] (1 + y^2)^2), -1 < Im[y] < 1 || Im[y] > 1 || Im[y] < -1]
and then
Integrate[(2 y)/(\[Pi] (1 + y^2)^2), {y, 0, Infinity}]
out:1/\[Pi]
From the denominator the poles can be solved as
{{x -> -I - y}, {x -> -I - y}, {x -> -I - y}, {x -> I - y}, {x ->
I - y}, {x ->
I - y}, {x -> -I + y}, {x -> -I + y}, {x -> -I + y}, {x ->
I + y}, {x -> I + y}, {x -> I + y}}
I guess we can get some ideas from firstly find a numerical solution of this example.
Update
The integration of myf
will be dependent of order of integral. This maybe the reasons why MMA can't give the correct answer.
y == (-2 - I) - x || y == -I - x || y == I - x || y == (2 + I) - x || y == (-2 - I) + x || y == -I + x || y == I + x || y == (2 + I) + x
. I don't know good numerical methods for multple improper integras. Try to cut the tails, replacingInfinity
by100
. $\endgroup${y, 0,2+x,-Infinity}
, here I ignore the imaginary part. And this is an integration along real axis, i don't know why the poles with imaginary parts maybe hurt the integration. I trust the integration will be converged due to the power counting of x, as @user64494 said. $\endgroup$