# How to calculate that integral without any error messages?

My attempts

 NIntegrate[Zeta[2 + w*I]^2*8^(2 + w*I)/(2 + w*I), {w, -Infinity, Infinity},
WorkingPrecision -> 15, AccuracyGoal -> 3, PrecisionGoal -> 3]


and

NIntegrate[Zeta[2 + w*I]^2*8^(2 + w*I)/(2 + w*I), {w, -Infinity, Infinity},
Method -> "ExtrapolatingOscillatory", WorkingPrecision -> 15, AccuracyGoal -> 3, PrecisionGoal -> 3]


and

NIntegrate[Zeta[2 + w*I]^2*8^(2 + w*I)/(2 + w*I), {w, -Infinity, Infinity},
Method -> "GlobalAdaptive", WorkingPrecision -> 15, AccuracyGoal -> 3, PrecisionGoal -> 3]


perform

(*112.397602019569 - 0.0476573486479931 I*)


and the error communication

NIntegrate::ncvb:NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in w near {w}={169.666666666667}.NIntegrate obtained 112.397602019569-0.0476573486479931 I and 3.5357927689181715. for the integral and error estimates.

as a bonus.

In order to get rid of error messages, the Quiet command is not taken into account.

• Integrate  says, this integral does not converge. – Akku14 Apr 22 '20 at 12:13
• Most likely, you are using WorkingPrecision wrong. Why do you set the working precision to be 15? – Anton Antonov Apr 22 '20 at 12:21
• @Akku: Thank you. Can that statement be based? Every command has its limitations. – user64494 Apr 22 '20 at 12:29
• @Anton Antonov: Can you kindly suggest a better option? – user64494 Apr 22 '20 at 12:30
• @Akku 14: The command Integrate[ Evaluate[ComplexExpand[ Re[Zeta[2 + w*I]^2*8^(2 + w*I)/(2 + w*I)]]], {w, -Infinity, Infinity}] is running for long time without any error communication. – user64494 Apr 22 '20 at 13:02

First note that the result of the Integral must be real since

$$(\int_{-\infty}^{\infty} \frac{8^{2+i w}}{2+i w}\zeta (i w+2)^2 \, dw)^\ast = \int_{-\infty}^{\infty} \frac{8^{2-i w}}{2-i w}\zeta (-i w+2)^2 \, dw = \int_{-\infty}^{\infty} \frac{8^{2+i w'}}{2+i w'}\zeta (i w'+2)^2 \, dw'$$

where $$w' = -w$$. The integrand is highly oscillatory and decreases fast so there is not much to gain by specifying the limits at $$\infty$$. You can do it without errors by increasing the working precision and specifying a finite numerical integration limit as follow:

Int[W_] :=
NIntegrate[Re[Zeta[2 + w*I]^2*8^(2 + w*I)/(2 + w*I)], {w, -W, W},
WorkingPrecision -> 30, AccuracyGoal -> 3, PrecisionGoal -> 3];
Table[{W, Int[W]}, {W, 0, 200, 10}]
ListLinePlot[%, Mesh -> Full, PlotRange -> Full]


which yields the following results without error messages

{{0, 0}, {10, 117.644687513319946046802879277}, {20,
114.575303504772377060321078067}, ...
113.956032525809081682569215295}, {180,
112.921219819275271019140358492}, {190,
112.131832550130353341971791461}, {200,
112.536621410476756643360381626}}


• Thank you for your work. This is not it. – user64494 Apr 22 '20 at 12:22
• "the Integral must be real" - by this reasoning, it means that we can consider the integrand (32 (2^(-3 I w) (2 + I w) Zeta[2 - I w]^2 + 2^(3 I w) (2 - I w) Zeta[2 + I w]^2))/(4 + w^2). – J. M.'s ennui Apr 22 '20 at 12:26
• @J.M. : Thank you. Can you suggest what I should do next? – user64494 Apr 22 '20 at 12:43
• @user, you haven't "based" your (implied) claim that this is a convergent integral, so I haven't done anything further. – J. M.'s ennui Apr 22 '20 at 12:47
• @Omrie Ovdat: Your statement "the result of the Integral must be real since... " assumes the integral is convergent (That may not be correct.) ot its principal value. – user64494 Apr 22 '20 at 12:58

I find the answer on my own (It seems the integral of the real part of the integrand converges.)

NIntegrate[Evaluate[ComplexExpand[ Re[Zeta[2 + w*I]^2*8^(2 + w*I)/(2 + w*I)]]],
{w, -Infinity,Infinity}, WorkingPrecision -> 15, AccuracyGoal -> 3, PrecisionGoal -> 3]
(*110.677985578146*)


NIntegrate[Evaluate[ComplexExpand[Im[Zeta[2 + w*I]^2*8^(2 + w*I)/(2 + w*I)]]],
{w, 0, Infinity}, Method -> "ExtrapolatingOscillatory", WorkingPrecision -> 100,
AccuracyGoal -> 2, PrecisionGoal -> 2]
(*32.6314986099761388250389849791092223455806688267066202788888718292899\
6103218885341303274331595001435*)
`