Re: Why does this happen?
- To: mathgroup at smc.vnet.net
- Subject: [mg78759] Re: Why does this happen?
- From: David Reiss <dbreiss at gmail.com>
- Date: Sun, 8 Jul 2007 06:20:23 -0400 (EDT)
- References: <f6ks38$lbm$1@smc.vnet.net>
OK, since most folks didn't catch Budasoy's typo in the Exp. Here is an "analysis" of the problem (Mathematica 6.01. There does appear to be a numerical inconsisstency between the exact result and the numerical one. Is this possibly due to the singularity of the integrand at 0? Or perhaps we have a bug... 'tis not clear to me before my morning coffee... (M 6) In[1]:= Integrate[Log[1 + Exp[-x]/Sqrt[x]], {x, 0, Infinity}] (M 6) Out[1]= \[Pi]^2/6 (M 6) In[2]:= Limit[Log[1 + Exp[-x]/Sqrt[x]], x -> Infinity] (M 6) Out[2]= 0 (M 6) In[3]:= Limit[Log[1 + Exp[-x]/Sqrt[x]], x -> 0] (M 6) Out[3]= \[Infinity] (M 6) In[4]:= N[\[Pi]^2/6] (M 6) Out[4]= 1.64493 (M 6) In[5]:= Table[ NIntegrate[Log[1 + Exp[-x]/Sqrt[x]], {x, 10^-n, n 10}], {n, 1, 10}] (M 6) Out[5]= {0.837883, 0.989369, 1.01402, 1.01748, 1.01793, \ 1.01798, 1.01799, 1.01799, 1.01799, 1.01799} (M 6) In[6]:= Integrate[Log[1 + Exp[-a x]/x^(1/n)], {x, 0, Infinity}, Assumptions -> {Re[1/n] < 1, a > 0}] (M 6) Out[6]= (n \[Pi]^2)/(12 a (-1 + n)) (M 6) In[7]:= (n \[Pi]^2)/(12 a (-1 + n)) /. {n -> 2, a -> 1} (M 6) Out[7]= \[Pi]^2/6 (M 6) In[8]:= quickanddirty[delta_] := Module[{data}, data = Table[ N@Log[1 + Exp[-x]/Sqrt[x]], {x, 10^-5, 10, delta}]; Tr[data delta] ]; (M 6) In[9]:= quickanddirty[10^-2] (M 6) Out[9]= 1.05924 (M 6) In[10]:= quickanddirty[10^-3] (M 6) Out[10]= 1.02151 (M 6) In[11]:= quickanddirty[10^-4] (M 6) Out[11]= 1.01823 On Jul 6, 3:47 am, Budaoy <yaomengli... at gmail.com> wrote: > I have a problem in calculating this integral shown below: > > Integrate[Log[1+Exp[x]/Sqrt[x]],{x,0,Infinity}] > Pi^2/6 > > N[%] > 1.64493 > > NIntegrate[Log[1+Exp[x]/Sqrt[x]],{x,0,Infinity}] > 1.01799 > > Where does this difference come from and which one is correct?