MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Numerical integration

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79675] Re: [mg79621] Numerical integration
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Wed, 1 Aug 2007 05:12:22 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

Version 6 appears to have a problem with this integral.

$Version

6.0 for Mac OS X x86 (32-bit) (June 19, 2007)

expr1 = Integrate[Log[1 + z^2]*(BesselJ[1, z]^2/z), {z, 0, Infinity}]

(1/2)*HypergeometricPFQ[{1/2}, 
     {1, 2}, 1]*(1 - 2*EulerGamma + 
      Log[4])

expr2 = expr1 // FunctionExpand // Simplify

(-(1/2))*(BesselI[0, 1]^2 - 
      BesselI[1, 1]^2)*
   (-1 + 2*EulerGamma - Log[4])

expr1 // N

0.790559

expr2 // N

0.790559

NIntegrate[Log[1 + z^2]*(BesselJ[1, z]^2/z), {z, 0, Infinity}]

0.869058


Bob Hanlon

---- dimitris <dimmechan at yahoo.com> wrote: 
> In[3]:=
> Integrate[Log[1 + z^2]*(BesselJ[1, z]^2/z), {z, 0, Infinity}]
> N[%, 10]
> 
> Out[3]=
> MeijerG[{{1/2}, {}}, {{0, 0}, {-1}}, 1]/(2*Sqrt[Pi])
> 
> Out[4]=
> 0.8732180258611361020606751916`10.
> 
> On another CAS I took,
> 
> convert("Integrate[Log[1 + z^2]*(BesselJ[1, z]^2/z), {z, 0,
> Infinity}]",FromMma,evaluate);
> evalf(%,20);
> 
>            1/2
>   1/2 (2 Pi    BesselI(0, 1) BesselK(0, 1)
> 
>                1/2                                /   1/2
>          + 2 Pi    BesselK(1, 1) BesselI(1, 1))  /  Pi
>                                                 /
> 
>                         0.87321802586113613925
> 
> Both CAS return the same symbolic result.
> [An interesting challenge is to simplify the MeijerG
> output of Mathematica to that of the other CAS]
> 
> I want to check this symbolic result with NIntegrate.
> I have "played around" with the options but I could get
> "more closely" than
> 
> In[16]:=
> NIntegrate[Log[1+z^2]*(BesselJ[1,z]^2/z),{z,
>       0, },MaxRecursion\[Rule]18]//InputForm
> 
> >From In[16]:=
> \!\(\*
>   RowBox[{\(NIntegrate::"slwcon
>       "\), \(\(:\)\(\ \)\), "\<\"Numerical integration
>     converging too slowly; suspect
>     one of the following: singularity, value of the integration being
> 0, \
> oscillatory integrand, or insufficient WorkingPrecision. If your
> integrand is \
> oscillatory try using the option Method->Oscillatory in NIntegrate. \
> \\!\\(\\*ButtonBox[\\\"More...\\\", ButtonStyle->\\\"RefGuideLinkText\\
> \", \
> ButtonFrame->None, ButtonData:>\\\"NIntegrate::slwcon\\\"]\\)\"\>"}]\)
> 
> >From In[16]:=
> \!\(\*
>   RowBox[{\(NIntegrate::"ncvb"\), \(\(:\)\(\ \)\), "\<\"NIntegrate
> failed
>     to converge to prescribed accuracy
>     after \\!\\(19\\) recursive bisections in \\!\\(z\\) near \\!\\(z\
> \) = \
> \\!\\(35857.55603944016`\\). \\!\\(\\*ButtonBox[\\\"More...\\\", \
> ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \
> ButtonData:>\\\"NIntegrate::ncvb\\\"]\\)\"\>"}]\)
> 
> Out[16]//InputForm=
> 0.8732193803103058
> 
> I would be very happy if someone pointed a tactic for perfroming
> satisfactory numerical integration with mathematica for this integral.
> I use mathematica 5.2 but you can use Mathematica 6 as well!
> 
> The integral arose in another forum. There it was pointed out that
> the performance of Mathematica 6 is buggy as regards numerical
> integration.
> 
> I look forward to seeing any replies.
> 
> Greetings from burning Greece!
> 
> Dimitris
> 
> PS
> 
> See here
> 
> http://groups.google.gr/group/sci.math.symbolic/browse_thread/thread/57af36ff6f540a0d/a076ffbc412f974a?hl=el#a076ffbc412f974a
> 
> for above mentioned thread.
> 
> 



  • Prev by Date: Re: Re: Re: Where is the Navigate menu
  • Next by Date: Re: Unbearably slow plotting (v6)
  • Previous by thread: Re: Numerical integration
  • Next by thread: Re: Numerical integration