       # Re: problem with Integrate

```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:=Integrate[f[x,Sqrt],{x,0,z}] Out=
-((Pi^2 + E^(Sqrt*z)*Pi^2 - 18*E^(Sqrt*z)*z^2 +
12*Sqrt*z*Log[1 + E^(Sqrt*z)] +
12*Sqrt*E^(Sqrt*z)*z*Log[1 + E^(Sqrt*z)] +
12*PolyLog[2, -E^(Sqrt*z)] +
12*E^(Sqrt*z)*PolyLog[2, -E^(Sqrt*z)])/
(18*(1 + E^(Sqrt*z))))

In:=FullSimplify[%]
Out=
-(Pi^2/18) + z^2 - z^2/(1 + E^(Sqrt*z)) -
(2*z*Log[1 + E^(Sqrt*z)])/Sqrt -
(2*PolyLog[2, -E^(Sqrt*z)])/3

In:=Out /. b -> 100
Out=
10000 - 10000/(1 + E^(100*Sqrt)) - Pi^2/18 -
(200*Log[1 + E^(100*Sqrt)])/Sqrt -
(2*PolyLog[2, -E^(100*Sqrt)])/3

In:=List @@ %
Out=
{10000, -10000/(1 + E^(100*Sqrt)), -(Pi^2/18),
(-200*Log[1 + E^(100*Sqrt)])/Sqrt,
(-2*PolyLog[2, -E^(100*Sqrt)])/3}

In:=%//N
Out=
-72
{10000., -5.99776 10   , -0.548311, -20000., 10001.1}

In:=Plot[Evaluate[%16],{b,0,12}]
(* shows regular plot *)
In:=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],{x,0,Infinity}] Out:   0
>
>I think that it is wrong, since
>
>In:    Pi^2/6/b^2 /. b->Sqrt //N
>Out:   0.548311
>
>In:    NIntegrate[f[x,Sqrt],{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

```

• Prev by Date: RE: "flattening" systems of eq
• Next by Date: RE: How to draw an ellipse?
• Prev by thread: problem with Integrate