# Numerical integration of double integral with two variables

I am trying to numerically integrate the following double integral in MATHEMATICA. This question has also been asked at Wolfram Community where $$Im$$ is the imaginary part of the expression, $$i$$ is the imaginary number, $$x$$ and $$y$$ are variables while $$a, b, c$$ and $$Q$$ are constants greater than 0.

Here is my attempt to solve this.

a = 3
b = 0.0137
c = 0.0023
Q = 6
NIntegrate[
Im[Exp[-I x c + b (I x y/(y^a - I x))]]/x, {x, 0, ∞}, {y, 0, Q},
AccuracyGoal -> 10]


Is this the correct way of applying numerical integration with more than one variable? I am getting an error when I run this expression which reads as

evaluated to non-numerical values for all sampling points in the \region with boundaries {{[Infinity], 0.},{0, 6}}.

Can anyone please guide me to correct the implementation of the expression given above.

• Your integrand should be Im[Exp[-I x c + b (I x y/(y^a - I x))]]/x not Im[Exp[-I x c + b (i x y/(y^a - I x))]]/x. Voting to close. Sep 4 '20 at 15:02
• This integral does not converge because for small x the integrand behaves as 1/x. Sep 4 '20 at 15:10
• @Artes Is there any way around to avoid that? If the x values are restricted to be a larger value then it should work, right? Sep 4 '20 at 15:37
• When you simultaneously cross-post the same question (community.wolfram.com/groups/-/m/t/2070465), you should mention that in both posts.
– JimB
Sep 4 '20 at 16:17
• @Artes: The integral under consideration converges at the origin in view of ComplexExpand[ Normal[Series[ Im[Exp[-I x c + b (I x y/(y^a - I x))]]/x , {x, 0, 1}]]] /. {x -> r*Cos[\[Phi]], y -> r*Sin[\[Phi]]}] which results in -(1/r)E^(-((137 r^3 Cos[\[Phi]]^2 Sin[\[Phi]])/( 10000 (r^2 Cos[\[Phi]]^2 + r^6 Sin[\[Phi]]^6)))) Sec[\[Phi]] Sin[(23 r Cos[\[Phi]])/10000 - ( 137 r^5 Cos[\[Phi]] Sin[\[Phi]]^4)/( 10000 (r^2 Cos[\[Phi]]^2 + r^6 Sin[\[Phi]]^6))].. Sep 5 '20 at 6:45

ComplexExpand the functions and integrate separately.(Because I am in a hurry, i don't show intermediate results)

ceRe = ComplexExpand[Re[(I x y)/(y^3 - I x)],
TargetFunctions -> {Re, Im}]

ceIm = ComplexExpand[Im[(I x y)/(y^3 - I x)],
TargetFunctions -> {Re, Im}]

intRe[x_] = Integrate[ceRe, {y, 0, 6}, Assumptions -> x > 0]

intIm[x_] = Integrate[ceIm, {y, 0, 6}, Assumptions -> x > 0]

ii[x_] = ComplexExpand[Im[Exp[-I x c + b*(intRe[x] + I intIm[x])]]/x,
TargetFunctions -> {Re, Im}] /. {b -> 137/10000, c -> 23/10000} //
Simplify[#, x > 0] &

Plot[ii[x], {x, 0, 10000}]

nint = NIntegrate[ii[x], {x, 0, \[Infinity]}, MaxRecursion -> 50]

(*   -0.989098   *)