0
$\begingroup$

I am new in Mathematica, I try to find the following numerical integral. but I get the error message ( NIntegrate failed to converge to prescribed accuracy ...), I know that there is a divergence since there is a rho in the denominator of the fraction but how can I solve that?I think I should transform the integral any help? can any one transform the integral for me

NIntegrate[ρ*Replace[f[5], 
   f[l_] :> {0, ((155*2)/ρ)*
       Integrate[
        BesselJ[l, 23*y]^2*y, {y, 0, ρ}], (6.75*2*l*
         Integrate[BesselJ[l, 23*y]^2/y, {y, ρ, Infinity}])/
       10^2} . 
           {0, -D[(6.75*2*l*
           Integrate[BesselJ[l, 23*y]^2/y, {y, ρ, Infinity}])/
         10^2, ρ], (1/ρ)*
       D[ρ*(((155*2)/ρ)*
           Integrate[
            BesselJ[l, 23*y]^2*y, {y, 
             0, ρ}]), ρ]}], {ρ, 0, Infinity}, 
   WorkingPrecision -> 10]
$\endgroup$
3
  • 5
    $\begingroup$ Please edit your question: prior to copy and paste, convert your cell to InputForm (or Raw InputForm) $\endgroup$
    – Bob Hanlon
    Commented Aug 17, 2022 at 23:08
  • $\begingroup$ How I edit that? $\endgroup$
    – sara
    Commented Aug 19, 2022 at 11:03
  • 1
    $\begingroup$ Click on the word Edit below the question $\endgroup$
    – Bob Hanlon
    Commented Aug 19, 2022 at 13:40

1 Answer 1

2
$\begingroup$

Step 1. The expression provided by OP can be cleaned up a bit. For example, this is a subexpression of the expression provided by OP, with the exception that I put an Inactive in to get Mathematica to exploit the fact that there is derivative D just outside:

D[ρ*(((155*2)/ρ)*Inactive[Integrate][BesselJ[l,23*y]^2*y,{y,0,ρ}]),ρ]

This simplifies to

310*ρ*BesselJ[l,23*ρ]^2

Step 2. Doing Step 1 for the entire integrand that OP has provided, I get the following simpler formula for the integrand, where I also replaced 41.85 by 4185/100 to avoid problems with floating point numbers:

integrand[l_]:=integrand[l]=Assuming[ρ>0, 4185/100 l BesselJ[l, 23 ρ]^2 (
    ρ^2 Integrate[BesselJ[l, 23 y]^2/y, {y, ρ, \[Infinity]}]
    + Integrate[y BesselJ[l, 23 y]^2, {y, 0, ρ}])/ρ//Simplify];

This can be evaluated. For example, taking the value l==5 in the question:

integrand[5]
(* (1/(1566219705620 ρ^7))837 (529 ρ^2 (-4608 + 
      101568 ρ^2 - 5596820 ρ^4 + 
      740179445 ρ^6) BesselJ[0, 23 ρ]^2 - 
   23 ρ (-18432 + 1625088 ρ^2 - 22387280 ρ^4 + 
      740179445 ρ^6) BesselJ[0, 23 ρ] BesselJ[1, 
     23 ρ] + (-18432 + 2843904 ρ^2 - 102981488 ρ^4 - 
      2960717780 ρ^6 + 391554926405 ρ^8) BesselJ[1, 
     23 ρ]^2) BesselJ[5, 23 ρ]^2 *)

Step 3. Let us plot this:

Plot[integrand[5],{ρ,0,5},PlotRange->All]

This gives

enter image description here

Looks nice, but decay seems slow. In fact, let us also plot ρ times the integrand:

Plot[integrand[5]*ρ,{ρ,0,5},PlotRange->All]

This gives

enter image description here

It seems likely that this oscillates forever with some fixed amplitude (see remark below). Thus integrand[5] is 1/ρ times this oscillation. That is too slow for convergence of the integral over {ρ,0,\[Infinity]}. Hence the integral does in fact not converge, it is $+\infty$.

The divergence is not due to the behavior near ρ==0, in fact the integrand decays quickly towards ρ==0. Rather, the divergence is due to slow decay as ρ goes to infinity.

Remark. The 1/ρ decay is due to the following terms in integrand[5]//Expand:

  ρ BesselJ[0, 23 ρ]^2 BesselJ[5, 23 ρ]^2
  ρ BesselJ[1, 23 ρ]^2 BesselJ[5, 23 ρ]^2
$\endgroup$
1
  • $\begingroup$ following your step, I get this result in step 2 (Assuming[[Rho] > 0, {0, (310/[Rho])* Integrate[ BesselJ[l, 23*y]^2*y, {y, 0, [Rho]}], ((675/100)*2*l* Integrate[BesselJ[l, 23*y]^2/y, {y, [Rho], Infinity}])/10^2} . {0, (0.135*l*BesselJ[l, 23*[Rho]]^2)/[Rho], 310*BesselJ[l, 23*[Rho]]^2}]). $\endgroup$
    – sara
    Commented Aug 23, 2022 at 11:42

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.