Re: problem with Integrate
- To: mathgroup@smc.vnet.net
- Subject: [mg10437] Re: [mg10368] problem with Integrate
- From: Wouter Meeussen <eu000949@pophost.eunet.be>
- Date: Tue, 13 Jan 1998 02:07:35 -0500
Alberto,
you have very well described the problem: the general cases often get
done more easily than the detailed ones: as complement to your
analysis:
In[39]:=Integrate[f[x,Sqrt[3]],{x,0,z}] Out[39]=
-((Pi^2 + E^(Sqrt[3]*z)*Pi^2 - 18*E^(Sqrt[3]*z)*z^2 +
12*Sqrt[3]*z*Log[1 + E^(Sqrt[3]*z)] +
12*Sqrt[3]*E^(Sqrt[3]*z)*z*Log[1 + E^(Sqrt[3]*z)] +
12*PolyLog[2, -E^(Sqrt[3]*z)] +
12*E^(Sqrt[3]*z)*PolyLog[2, -E^(Sqrt[3]*z)])/
(18*(1 + E^(Sqrt[3]*z))))
In[40]:=FullSimplify[%]
Out[40]=
-(Pi^2/18) + z^2 - z^2/(1 + E^(Sqrt[3]*z)) -
(2*z*Log[1 + E^(Sqrt[3]*z)])/Sqrt[3] -
(2*PolyLog[2, -E^(Sqrt[3]*z)])/3
In[41]:=Out[25] /. b -> 100
Out[41]=
10000 - 10000/(1 + E^(100*Sqrt[3])) - Pi^2/18 -
(200*Log[1 + E^(100*Sqrt[3])])/Sqrt[3] -
(2*PolyLog[2, -E^(100*Sqrt[3])])/3
In[42]:=List @@ %
Out[42]=
{10000, -10000/(1 + E^(100*Sqrt[3])), -(Pi^2/18),
(-200*Log[1 + E^(100*Sqrt[3])])/Sqrt[3],
(-2*PolyLog[2, -E^(100*Sqrt[3])])/3}
In[43]:=%//N
Out[43]=
-72
{10000., -5.99776 10 , -0.548311, -20000., 10001.1}
In[23]:=Plot[Evaluate[%16],{b,0,12}]
(* shows regular plot *)
In[24]:=Plot[Evaluate[%16],{b,0,120}]
(* shows onset of numeric instability *)
my vision:
keep the input to Integrate as symbolic & general as possible, delay
substitution of constants into variables as long as possible.
don't tell me,
I know this didn't help much ...
wouter.
At 04:10 12-01-98 -0500, Alberto Ruiz wrote:
>I have 3.0.0.0 for Windows. Consider the function:
>
>In: f[x_,b_] := x^2 b Exp[b x] / (1+ Exp[b x])^2
>
>We can correctly obtain the integral:
>
>In: Integrate[f[x,b],{x,0,Infinity},Assumptions->{b>0}] Out:
>Pi^2/6/b^2
>
>However, using a particular value for the parameter:
>
>In: Integrate[f[x,Sqrt[3]],{x,0,Infinity}] Out: 0
>
>I think that it is wrong, since
>
>In: Pi^2/6/b^2 /. b->Sqrt[3] //N
>Out: 0.548311
>
>In: NIntegrate[f[x,Sqrt[3]],{x,0,Infinity}] Out: 0.548311
>
>Finally, if we try the following, The system takes a long time to
>answer and I must abort the evaluation:
>
>In: Integrate[f[x,1.73],{x,0,Infinity}]
>
>Apparently, the above behavior happens when the parameter b is
>substituted by expressions including square roots that cannot be
>simplified, and when the integration limit is Infinity.
>
>Any suggestion will be greatly appreciated.
>
>Alberto Ruiz
>
>
Dr. Wouter L. J. MEEUSSEN
w.meeussen.vdmcc@vandemoortele.be
eu000949@pophost.eunet.be