Lowering the precision goal slightly from 6
to 5
(perhaps advisable in a high-dimensional integral) and increasing MinRecursion
avoids both the NIntegrate::slwcon
and NIntegrate::eincr
warnings:
NIntegrate[
1/(px^2 + py^2 + 1)/((px - qx)^2 + (px - qy)^2 + 1)/(qx^2 + qy^2 + 1),
{px, 0, 10}, {py, 0, 10}, {qx, 0, 10}, {qy, 0, 10},
PrecisionGoal -> 5,
MinRecursion -> 1] // AbsoluteTiming
(* {5.563214`, 2.8471463223061835`} *)
Update: Alternative
FWIW, you can do an expensive (i.e., takes time) symbolic integration on one or two of the variables, followed by a numerical integration. E.g, integrating over {py, 0, 10}
symbolically first takes about as long as the above and needs no other special numerical processing. The numerical advantage here is reducing the dimension of the integral. (In fact, if you integrate over qx
and then py
, then the two-dimensional integral is quite fast and unproblematic; however, the symbolic integration takes about 17 seconds.)
NIntegrate[
Evaluate@Integrate[
1/(px^2 + py^2 + 1)/((px - qx)^2 + (px - qy)^2 + 1)/(qx^2 + qy^2 + 1),
{py, 0, 10},
Assumptions -> 0 < px < 10 && 0 < py < 10 && 0 < qx < 10 && 0 < qy < 10]
, {px, 0, 10}, {qx, 0, 10}, {qy, 0, 10}] // AbsoluteTiming
(* {4.173041`, 2.8471449687848587`} *)
We also get the extra digit of accuracy @user64494 got.
Update 2: Third try, inspired by Mariusz Iwaniuk
There is a slight "spike" in the value of the integrand near the subspace px == qx == qy
. This might be why NIntegrate
has trouble getting the error estimate to satisfy precision goals of 6 or more. Some weak evidence is that feeding the subspace as an "Exclusion"
with the "LocalAdaptive"
method to NIntegrate
gives a fairly quick solution agreeing with the other solutions to slightly more than six digits.
NIntegrate[
1/(px^2 + py^2 + 1)/((px - qx)^2 + (px - qy)^2 + 1)/(qx^2 + qy^2 + 1),
{px, 0, 10}, {py, 0, 10}, {qx, 0, 10}, {qy, 0, 10},
Method -> "LocalAdaptive", Exclusions -> {px == qx == qy}] // AbsoluteTiming
(* {3.497589`, 2.8471576198024686`} *)
NIntegrate::slwcon
if there are no other errors. (So you left out an important component of the question. You also left out the error message names, which are helpful to include because then people with similar problems can search the site for them.) $\endgroup$