2
$\begingroup$

I have trouble evaluating the following numerical integral,

$$ \int_{0}^{\infty} d k^{(yz)} \, k^{(yz)} J_{0} \left(d^{(yz)} k^{(yz)} \right) \frac{e^{-i d_x \sqrt{k_R^2 + {k^{(yz)}}^{2} }}}{ \sqrt{k_R^2 + {k^{(yz)}}^{2} }} \\ \times \left(\sqrt{k_R^2 + {k^{(yz)}}^{2} } - k_R \tilde{v} \right)^{q} \left( \tilde{v}\sqrt{k_R^2 + {k^{(yz)}}^{2} } - k_R \right)^{p} \, . $$ Here, p and q are positive integers, and $k_R$ and $\tilde{v}$ are positive real numbers. The naive ansatz

dyz=10*10^(-9);vt=0.0001;kR= 1.41705*10^9;
NIntegrate[ 
     BesselJ[0, dyz * kyz] * kyz *
  (1/Sqrt[kR^2 + kyz^2])
  E^(-I Sqrt[kR^2 + kyz^2]) (-kR*vt + 
     Sqrt[kR^2 + kyz^2])^
   p (-kR + vt Sqrt[kR^2 + kyz^2])^
   q, {kyz, 0, Infinity}]

gives the warning "NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections..."

I would be happy if one of you can help me.

$\endgroup$
1
  • $\begingroup$ Please provide a self-contained example, including exemplary values for the undefined constants. You will receive much better answers if your code actually runs. $\endgroup$
    – Roman
    Commented Jun 16, 2022 at 16:31

3 Answers 3

5
$\begingroup$

Not a stand-alone response, just a follow-up to the response by @user64494 that already settles the issue. We'll do an exact integration here.

ee = BesselJ[0, dyz*kyz]*kyz/Sqrt[kR^2 + kyz^2]*
    E^(-I*Sqrt[kR^2 + kyz^2])* (-kR*vt + Sqrt[kR^2 + kyz^2])^
     p *(-kR + vt*Sqrt[kR^2 + kyz^2])^q /. {dyz -> 10^(-8), 
    vt -> 1/10000, kR -> 141705*10^4};

Let's assume p + q > 1. then Integrate correctly finds that this diverges.

Integrate[ee, {kyz, 0, Infinity}, 
 Assumptions -> {p > 0, q > 0, p + q > 1}]

(* During evaluation of In[116]:= Integrate::idiv: Integral of (E^(-I Sqrt[2008030702500000000+kyz^2]) kyz (-1417050000+Sqrt[<<1>>]/10000)^q (-141705+Sqrt[2008030702500000000+kyz^2])^p BesselJ[0,kyz/100000000])/(Sqrt[2008030702500000000+kyz^2]) does not converge on {0,\[Infinity]}.

Out[116]= Integrate[(E^(-I Sqrt[2008030702500000000 + kyz^2])
     kyz (-1417050000 + Sqrt[2008030702500000000 + kyz^2]/10000)^
    q (-141705 + Sqrt[2008030702500000000 + kyz^2])^
    p BesselJ[0, kyz/100000000])/(Sqrt[
   2008030702500000000 + kyz^2]), {kyz, 0, \[Infinity]}, 
 Assumptions -> {p > 0, q > 0, p + q > 1}] *)
$\endgroup$
10
  • $\begingroup$ This proves the divergence only for concrete values of dyz, vt, kR, but not for the general case {kR, vt, dyz} > 0. The above answer is only wishful thinking. $\endgroup$
    – user64494
    Commented Jun 20, 2022 at 18:08
  • $\begingroup$ The true answer is obtained in version 13 on Windows 10 by Integrate[ee, {kyz, 0, Infinity}, Assumptions -> {p > 0, q > 0, p + q > 1, kR > 0, vt > 0, dyz > 0}]. BTW, I made the screen of the answer by Daniel. $\endgroup$
    – user64494
    Commented Jun 20, 2022 at 18:13
  • $\begingroup$ DanielLichblau (@ does not work.) :Up to standard textbooks on calculus, the condition {p>0, q>0, p+q>1/2} is enough for the divergence. $\endgroup$
    – user64494
    Commented Jun 20, 2022 at 18:23
  • $\begingroup$ No, but it showed the difference between Integrate and NIntegrate. For the general case: In[2]:= Integrate[ee, {kyz, 0, Infinity}, Assumptions -> {p > 0, q > 0, p + q > 1}] Integrate::idiv: Integral of ... does not converge on {0, Infinity}... (edited for readibility and length). $\endgroup$ Commented Jun 20, 2022 at 18:27
  • $\begingroup$ DanielLichblau (@ does not work.) Sorry, don't understand your latest comment where you repeat my comment concerning the true answer. Did you already look in textbooks on calculus? $\endgroup$
    – user64494
    Commented Jun 20, 2022 at 18:31
3
$\begingroup$

If I am not mistaken, the result of

Normal[Series[BesselJ[0, dyz*kyz]*kyz*(1/Sqrt[kR^2 + kyz^2])
E^(-I Sqrt[kR^2 + kyz^2]) (-kR*vt + Sqrt[kR^2 + kyz^2])^
p (-kR + vt Sqrt[kR^2 + kyz^2])^q, {kyz, Infinity, 1}, 
Assumptions -> {p, q} \[Element]  PositiveIntegers && {kR, vt, dyz, kyz} > 0]] // Simplify

(1/(dyz^(5/2) Sqrt[\[Pi]]))(1/16 + I/16) E^(-((I (kR^2 + 2 kyz^2))/( 2 kyz))) kyz^(-(3/2) + p + q) vt^q (dyz (I + 8 dyz kyz) (Cos[dyz kyz] - I Sin[dyz kyz]) + (-I + 8 dyz kyz) Abs[ dyz] (-I Cos[dyz kyz] + Sin[dyz kyz]))

implies the divergence at infinity (pay your attention to kyz^(-(3/2) + p + q)).

$\endgroup$
4
  • $\begingroup$ Yes right, for several p and q, the integrand diverges for kyz->infinity. But the integrand is heavily oscillatory leading to a finite integral? I am not sure about that statement, but NIntegrate gives finite results for the integral apart from the large error of course. $\endgroup$
    – Chopin
    Commented Jun 16, 2022 at 16:41
  • $\begingroup$ @Chopin: Your words "But the integrand is heavily oscillatory..." do not correspond to reality because E^(-((I (kR^2 + 2 kyz^2))/( 2 kyz))) oscillates at infinity as Sin[2*kyz] and Cos[2*kyz] as well as the multiplier (-I Cos[dyz kyz] + Sin[dyz kyz])). $\endgroup$
    – user64494
    Commented Jun 16, 2022 at 16:48
  • $\begingroup$ Please elaborate a bit on that. So you are essentially saying that the integral should diverge because of kyz^(-(3/2) + p + q) being divergent, right? I mean from that I would also guess that the integral diverges, but I wonder why Mathematica is not telling me this (gives me a finite result even). Furthermore, this integral corresponds to a physical observable which is of course expected to be finite. Thanks for helping me out! $\endgroup$
    – Chopin
    Commented Jun 16, 2022 at 17:00
  • 2
    $\begingroup$ NIntegrate generally will not be able to deduce divergence. Integrate can more often do this. $\endgroup$ Commented Jun 16, 2022 at 17:06
0
$\begingroup$

Both

Integrate[(1/(dyz^(5/2) Sqrt[\[Pi]])) (1/16 + 
I/16) E^(-((I (kR^2 + 2 kyz^2))/(2 kyz))) kyz^(-(3/2) + p + q) vt^
q (dyz (I + 8 dyz kyz) (Cos[dyz kyz] - I Sin[dyz kyz]) + (-I + 
8 dyz kyz) Abs[dyz] (-I Cos[dyz kyz] + Sin[dyz kyz])), {kyz, 1, Infinity}, 
 Assumptions -> {p > 0, q > 0, p + q > 1, kR > 0, vt > 0, dyz > 0}]

Integrate::idiv: Integral of (E^(-((I (kR^2+2 <<3>>^2))/(2 kyz))) kyz^(p+q) vt^q ((-1+8 dyz kyz) Cos[dyz kyz]+(1+8 dyz kyz) Sin[dyz kyz]))/(8 (dyz kyz)^(3/2) Sqrt[[Pi]]) does not converge on {1,[Infinity]}.

and

Integrate[BesselJ[0, dyz*kyz]*kyz/Sqrt[kR^2 + kyz^2]*
E^(-I*Sqrt[kR^2 + kyz^2])*(-kR*vt + Sqrt[kR^2 + kyz^2])^p*
(-kR + vt*Sqrt[kR^2 + kyz^2])^q, {kyz, 0, Infinity}, 
Assumptions -> {p > 0, q > 0, p + q > 3/2, kR > 0, vt > 0, dyz > 0}]

Integrate::idiv: Integral of (E^(-I Sqrt[kR^2+kyz^2]) kyz (Sqrt[kR^2+kyz^2]-kR vt)^p (-kR+Sqrt[kR^2+kyz^2] vt)^q BesselJ[0,dyz kyz])/Sqrt[kR^2+kyz^2] does not converge on {0,[Infinity]}.

show the divergence in the general case.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.