[Date Index]
[Thread Index]
[Author Index]
Re: Improper Integral & Mathematica
*To*: mathgroup at smc.vnet.net
*Subject*: [mg80621] Re: Improper Integral & Mathematica
*From*: dimitris <dimmechan at yahoo.com>
*Date*: Sun, 26 Aug 2007 23:21:57 -0400 (EDT)
*References*: <faraa2$4k6$1@smc.vnet.net>
On 26 , 10:32, expizzai... at gmail.com wrote:
> Hi all ! :-)
>
> how to solve:
>
> Integrate[(e^x) / (1 + e^(2x)), {x, - Infinity, + Infinity }]
>
> using Mathematica? I'm trying "e^x = t" but won't work...
>
> TNX!
In[7]:=
$Version
Out[7]=
5.2 for Microsoft Windows (June 20, 2005)
I guess you mean E(xponential) instead of e.
If so,
In[8]:=
Integrate[E^x/(1 + E^(2*x)), {x, -Infinity, Plus[Infinity]}]
{N[%], NIntegrate[E^x/(1 + E^(2*x)), {x, -Infinity, Plus[Infinity]}]}
(*check*)
Out[8]=
Pi/2
Out[9]=
{1.5707963267948966, 1.5707963269014895}
With your proposed substitution the result is also the same:
In[18]:=
(E^x/(1 + E^(2*x)))*Dt[x] /. x -> Log[t] /. Dt[t] -> 1
Integrate[%, {t, 0, Infinity}]
Out[18]=
1/(1 + t^2)
Out[19]=
Pi/2
Dimitris
PS
Here is also a nice trick I find it useful many times.
Note however that it is not pannacea, and you must
be very careful when you use it.
Say you indeed mean e and not E(xponential).
Then the integral stays unevaluated.
In[66]:=
Integrate[e^x/(1 + e^(2*x)), {x, -Infinity, Plus[Infinity]}]
Out[66]=
Integrate[e^x/(1 + e^(2*x)), {x, -Infinity, Infinity}]
However,
In[67]:=
Integrate[EulerGamma^x/(1 + EulerGamma^(2*x)), {x, -Infinity,
Plus[Infinity]}]
{N[%], NIntegrate[EulerGamma^x/(1 + EulerGamma^(2*x)), {x, -Infinity,
Plus[Infinity]}]}
res = %% /. EulerGamma -> e
Out[67]=
-(Pi/(2*Log[EulerGamma]))
Out[68]=
{2.858387543326428, 2.8583875434363413}
Out[69]=
-(Pi/(2*Log[e]))
So using this nice trick (replace e with EulerGamma, evaluate the
integral
and return to the original parameter) we have -(Pi/(2*Log[e])) as the
result.
Which is valid at least for 0<e<1 as the following shows.
In[72]:=
res/.e\[Rule]#&/@Range[0.1,0.9,0.1]
NIntegrate[(#^x)/(1+#^(2x)),{x,-Infinity,+Infinity}]&/
@Range[0.1,0.9,0.1]
Out[72]=
{0.682188,0.975991,1.30468,1.7143,2.26618,3.07501,4.404,7.0394,14.9088}
Out[73]=
{0.682188,0.975991,1.30468,1.7143,2.26618,3.07501,4.404,7.0394,14.9088}
Prev by Date:
**Re: Matrix Inverse Issue**
Next by Date:
**Re: BarChart inside a Frame. How to remove Labels from the top of the frame? How to put x-axis label below and not on the side?**
Previous by thread:
**Re: Improper Integral & Mathematica**
Next by thread:
** Global Variables in Options?**
| |