12

I'm trying to compute $\displaystyle \int_{-\infty}^\infty \frac{e^{ax}}{1+e^x}dx$, $(0<a<1)$
Let $f$ denote the integrand.

I'm using the rectangular contour given by the following curves:
$c_1: z(t) = R+it, t \in [0, 2\pi]$
$c_2: z(t) = -t+2\pi i, t \in [-R, R]$
$c_3: z(t) = -R + i (2\pi - t), t \in [0, 2\pi]$
$c_4: z(t) = t, t \in [-R, R]$

There is one singularity within the contour, at $z = \pi i$.
Expanding out the denominator as a power series shows that it's a simple pole, and allows us to evaluate the residue as
$\displaystyle \lim_{z \rightarrow \pi i} f(z)(z-\pi i) = - e^{a \pi i}$

This is computed by expanding $1+e^z$ as a Taylor series around $\pi i$. The first coefficient will be 0, and the second will be $-1$. The rest will have orders of $(z - \pi i)$ greater than 1, and will thus vanish when we take the limit.

So the integral over the entire contour is $- 2\pi i e^{a \pi i}$

An easy enough estimate on the $c_1$ shows that the integral vanishes as $R \rightarrow \infty$.
With a variable change, c_3 is the same as c_1 and also vanishes. $c_4$ becomes the integral we want when we take a limit. $c_2$ becomes $c_4$ with a constant:

\begin{align*} \int_{c_2} f(z)dz &= \int_{-R}^{R} \frac{e^{-at}e^{a 2\pi i}}{1+e^{-t}e^{2\pi i}}dt \\ &= e^{a 2 \pi i}\int_{-R}^{R} \frac{e^{-at}}{1+e^{-t}}dt \\ &=e^{a 2 \pi i}\int_{R}^{-R} - \frac{e^{au}}{1+e^{u}}du \ \ \ (u = -t, du = -dt) \\ &= e^{a 2 \pi i}\int_{-R}^{R} \frac{e^{au}}{1+e^{u}}du \\ &= e^{a 2 \pi i} I(R) \end{align*}

Where $I(R)$ is the line integral over $c_4$.
Putting it all together and taking the limit gives us
$\displaystyle \lim_{R \rightarrow \infty} I(R) = \frac{- 2\pi i e^{a \pi i}}{(1 + e^{a 2 \pi i}) }$

But this can't be the value of the integral, because it's a real-valued function integrated over $R$. I can't figure out where I'm going wrong. Note that I've avoided posting all the details of my solution since this is from a current problem set for a class on complex analysis.

Saigyouji
  • 838
  • Note the limit as you've written it is $-\pi i/ \cos a\pi$. Is there an extra or missing favor of $i$ somewhere, perhaps in the residue calculation? I'm too lazy to compute it. – MPW Jan 19 '14 at 02:58
  • How are you getting that? I've added a bit of explanation on the computation of the residue. – Saigyouji Jan 19 '14 at 03:06
  • 1
    $e^{iz}=\cos z + i \sin z$, so $\cos z = (e^{iz} + e^{-iz})/2$. Multiply top and bottom by $e^{iz}$ to get $\cos z = (e^{2iz} + 1)/2e^{iz}$. – MPW Jan 19 '14 at 03:18
  • check out http://math.stackexchange.com/questions/130472/residue-integral-int-infty-infty-fraceax1ex-dx-with-0?rq=1 too – ir7 Jan 19 '14 at 03:37
  • So @ir7 is showing that you omitted some poles in the calculation of residues – MPW Jan 19 '14 at 03:40
  • huh, surprised I missed that (the cosine expression). And apparently the cosine of a purely imaginary number is real, so it might just be a matter of finding a missing factor of $i$. I don't see any missing poles though. The numerator is entire, and the denominator is zero only if $-1 = e^z$, and this only happens in my contour when $z = \pi i$, for every $R>0$. – Saigyouji Jan 19 '14 at 04:05
  • It is indeed a simple sign-error. On $c_2$, you have $dz = -dt$, but you used $dz = dt$. – Daniel Fischer Jan 19 '14 at 12:32

3 Answers3

12

I think you may just have a simple sign error. Using the same contour you describe, I get that

$$\int_{-R}^R dx \frac{e^{a x}}{1+e^x} + i \int_0^{2 \pi} dy \frac{e^{a (R + i y)}}{1+e^{R+i y}} - e^{i a 2 \pi} \int_{-R}^R dx \frac{e^{a x}}{1+e^x} - i \int_0^{2 \pi} dy \frac{e^{a (-R + i y)}}{1+e^{-R+i y}} = -i 2 \pi e^{i a \pi}$$

As $R \to \infty$, the second integral (because $a \lt 1$) and the fourth integral (because $a \gt 0$) vanish. Thus we have

$$\int_{-\infty}^{\infty} dx \frac{e^{a x}}{1+e^x} = - i 2 \pi \frac{e^{i a \pi}}{1-e^{i 2 a \pi}} = \frac{\pi}{\sin{\pi a}}$$

Ron Gordon
  • 138,521
  • I'm still having trouble figuring out where the negative comes from in the third integral. In the computation I posted, I gain a negative from the substitution $u = -t$ but this substitution also flips my bounds of integration. So fixing those bounds kills the negative. – Saigyouji Jan 19 '14 at 14:39
  • Because in the original contour integral $z=x+i 2 \pi$ from $x \in [R,-R]$ in that order. You simply reverse the order of integration - that's all - and you get the negative sign. You do not need to introduce it artificially into the integral. – Ron Gordon Jan 19 '14 at 15:31
  • I'm using a slightly different parametrization, but seeing as your parametrization clearly gives you the needed negative, I double checked a few things and realized the problem. I was accidentally using the definition of a line integral over a scalar field, which uses the absolute value of the derivative. This was killing the negative I was supposed to get from differentiating $z(t) = -x + 2\pi i $ over $[-R, R]$. – Saigyouji Jan 19 '14 at 15:44
2

The residue can also be calculated without the use of a taylor series expansion

$$\lim_{z \to \pi i} \frac{(z-\pi i)\exp(az)}{1+\exp(z)} = \lim_{z \to \pi i} \frac{\exp(az)+ (z-\pi i) ~ a ~ \exp(az)}{\exp(z)} = - \exp(a ~ \pi~ i)$$

Since we can use L'Hôpital's rule.

Ben373
  • 393
1

Would it help you to make a change of variable $$x = \operatorname{Log}[y - 1]$$ ?

The integrand just becomes
$$\frac{(y - 1)^{a-1}}{ y}$$
and the integral has to be taken from $1$ to infinity.

Przemysław Scherwentke
  • 13,668
  • 5
  • 35
  • 56