# Exponential-Type Integrals

• POTW
Gold Member
MHB
POTW Director
Evaluate, with proof, the definite integral $$\int_{-\infty}^\infty \frac{e^{ax}}{1 + e^x}\, dx$$ where ##0 < a < 1##.

Greg Bernhardt and topsquark

## Answers and Replies

Homework Helper
2022 Award
Firstly, for $\operatorname{Re}(p) > 0$ and $\operatorname{Re}(q) > 0$ we have the following integral representations of the Beta function:
$$B(p,q) = \int_0^1 t^{p-1}(1 - t)^{q-1}\,dt = \int_0^\infty \frac{u^{p-1}}{(1 + u)^{p+q}}\,du.$$ Secondly, from the reflection formula of the Gamma function we have $$\Gamma(z)\Gamma(1-z) = B(z, 1-z) = \pi \csc(\pi z).$$

I imagine, however, that is not sufficient to just quote these, and that it is intended that one should prove the second result.

Gold Member
The integral

$$\int_{-\infty}^\infty \frac{e^{a (x+iy)}}{1 + e^{x+iy}} dx$$

for ##y = 2 \pi## is

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

The integral

\begin{align*}
\lim_{R \rightarrow \infty} \left| \int_0^Q \frac{e^{a R} e^{i a y}}{1 + e^R e^{iy}} dy \right| & = \lim_{R \rightarrow \infty} e^{- (1 - a) R} \left| \int_0^Q \frac{e^{i a y}}{e^{-R} + e^{iy}} dy \right|
\nonumber \\
& \leq \lim_{R \rightarrow \infty} e^{- (1 - a) R} \int_0^Q \frac{1}{\sqrt{e^{-2R} + 2 e^{-R} \cos y + 1}} dy
\nonumber \\
& \leq \lim_{R \rightarrow \infty} e^{- (1 - a) R} \int_0^Q \frac{1}{\sqrt{e^{-2R} - 2 e^{-R} + 1}} dy
\nonumber \\
& \leq \lim_{R \rightarrow \infty} e^{- (1 - a) R} \frac{1}{1-e^{-R}} Q
= 0 \quad (*)
\end{align*}

because ##a < 1##. The integral

\begin{align*}
\lim_{R \rightarrow \infty} \left| \int_0^Q \frac{e^{- a R} e^{i a y}}{1 + e^{-R} e^{iy}} dy \right| & = \lim_{R \rightarrow \infty} e^{- a R} \left| \int_0^Q \frac{e^{i a y}}{1 + e^{-R} e^{iy}} dy \right|
\nonumber \\
& \leq \lim_{R \rightarrow \infty} e^{- a R} \int_0^Q \frac{1}{\sqrt{e^{-2R} + 2 e^{-R} \cos y + 1}} dy
\nonumber \\
& \leq \lim_{R \rightarrow \infty} e^{- a R} \int_0^Q \frac{1}{\sqrt{e^{-2R} - 2 e^{-R} + 1}} dy
\nonumber \\
& \leq \lim_{R \rightarrow \infty} e^{- a R} \frac{1}{1-e^{-R}} Q
= 0 \quad (**)
\end{align*}

because ##a > 0##.

We define a rectangular contour integral:

\begin{align*}
& x \text{ integrated from } -R \text{ to } R, \; y =0
\nonumber \\
& x = R , \; y \text{ integrated from } 0 \text{ to } 2 \pi
\nonumber \\
& x \text{ integrated from } R \text{ to } -R, \; y = 2 \pi
\nonumber \\
& x = -R , \; y \text{ integrated from } 2 \pi \text{ to } 0
\end{align*}

This encloses a pole at ##z_0 = i \pi##. Near ##z_0 = i \pi## we have ##1 + e^z = 1 + e^{z_0} e^{z - z_0} = 1 - e^{z - z_0} = - (z - z_0)##, so that

$$\oint \frac{e^{a z}}{1 + e^z} dz = - 2 \pi i e^{i a \pi}$$

Then

\begin{align*}
- 2 \pi i e^{i a \pi} & = \oint \frac{e^{a z}}{1 + e^z} dz
\nonumber \\
& = \int_{-R}^R \frac{e^{a x}}{1 + e^x} dx + \int_0^{2 \pi} \frac{e^{a R} e^{i a y}}{1 + e^R e^{iy}} idy - e^{i 2 \pi a} \int_{-R}^R \frac{e^{a x}}{1 + e^x} dx - \int_0^{2 \pi} \frac{e^{- a R} e^{i a y}}{1 + e^{-R} e^{iy}} idy
\end{align*}

In the limit ##R \rightarrow \infty## we have:

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

where we have used ##(*)## and ##(**)##. So that

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

Last edited:
Gold Member
The correct answer to the integral

$$\int_{-\infty}^\infty \frac{e^{a x}}{1 + e^x} dx$$

can be obtained by closing the contour by a large semi circle in the upper or lower HP. But you need to give an argument for why the semi circle part of the integral can be taken to be zero. I'm not sure how rigorous an argument you can give.

Or you can follow @pasmith's suggestion.

Or you can evaluate the integral that @pasmith alludes to by a contour integral.

Homework Helper
2022 Award
The correct answer to the integral

$$\int_{-\infty}^\infty \frac{e^{a x}}{1 + e^x} dx$$

can be obtained by closing the contour by a large semi circle in the upper or lower HP. But you need to give an argument for why the semi circle part of the integral can be taken to be zero. I'm not sure how rigorous an argument you can give.

The idea would be that $$\begin{split} \left| \int_0^\pi \frac{e^{aR\cos \theta+iaR\sin\theta}}{1 + e^{R\cos\theta + iR\sin\theta}}iRe^{i\theta}\,d\theta \right| &\leq \pi R \sup_{\theta \in [0,\pi]} \left| \frac{e^{-(1-a)R\cos \theta}}{e^{-R\cos\theta} + e^{iR\sin\theta}} \right| \end{split}$$ tends to zero as $R \to \infty$.

Gold Member
The idea would be that $$\begin{split} \left| \int_0^\pi \frac{e^{aR\cos \theta+iaR\sin\theta}}{1 + e^{R\cos\theta + iR\sin\theta}}iRe^{i\theta}\,d\theta \right| &\leq \pi R \sup_{\theta \in [0,\pi]} \left| \frac{e^{-(1-a)R\cos \theta}}{e^{-R\cos\theta} + e^{iR\sin\theta}} \right| \end{split}$$ tends to zero as $R \to \infty$.
Do you have to be concerned about ##\theta = \pi/2##?

Homework Helper
2022 Award
Do you have to be concerned about ##\theta = \pi/2##?

Indeed.

Multiplying numerator and denominator by $e^{-R\cos\theta} + e^{-iR\sin\theta}$ gives $$\left| \frac{e^{-(1-a)R\cos\theta}}{e^{-R\cos\theta} + e^{iR\sin\theta}}\right| = \frac{e^{-(1-a)R\cos\theta}}{\sqrt{e^{-2R\cos\theta} + 2e^{-R\cos\theta}\cos(R\sin\theta) + 1}}.$$ For $\theta = \frac12\pi$ the denominator vanishes for $R = (2n + 1)\pi$, but in this case the pole at $x =( 2n+1)i\pi$ actually lies on the contour, so I think we exclude these values of $R$.

Fortunately, substituting $u = e^x$ and proceeding as in my original post avoids this difficulty.

Gold Member
Putting ##\theta = \pi/2## into:

$$\left| \frac{R e^{-(1-a)R\cos \theta} d \theta}{e^{-R\cos\theta} + e^{iR\sin\theta}} \right|$$

we get

$$\frac{R}{\sqrt{2 + 2 \cos (R)}} \qquad (*)$$

Which doesn't have a decaying term: ##e^{-C R}##. Also, as ##R## gets closer to ##(2n+1) \pi## the value of ##(*)## will increase without bound.

We could write

\begin{align*}
\left| \int_0^\pi \frac{e^{aR\cos \theta+iaR\sin\theta}}{1 + e^{R\cos\theta + iR\sin\theta}}iRe^{i\theta}\,d\theta \right|
& \leq \int_0^{\frac{\pi}{2} - \frac{\epsilon (R)}{2}} \left| \frac{R e^{-(1-a)R\cos \theta} d \theta}{e^{-R\cos\theta} + e^{iR\sin\theta}} \right| + \int_{\frac{\pi}{2} + \frac{\epsilon (R)}{2}}^\pi \left| \frac{R e^{aR\cos \theta} d \theta}{1 + e^{R\cos\theta + iR\sin\theta}} \right|
\nonumber \\
& + \left| \int_{\frac{\pi}{2} - \frac{\epsilon (R)}{2}}^{\frac{\pi}{2} + \frac{\epsilon (R)}{2}} \frac{e^{aR\cos \theta+iaR\sin\theta}}{1 + e^{R\cos\theta + iR\sin\theta}} Re^{i\theta}\,d\theta \right|
\end{align*}

for some appropriate ##\epsilon (R)##. The first two integrals on the RHS trivially tend to zero as ##R \rightarrow \infty##. The third integral is zero because the integrand oscillates wildly as ##R \rightarrow \infty##?

Last edited:
Homework Helper
2022 Award
The problem is that we have a sequence of poles $(2n + 1)i\pi$. So instread of taking a continuous liimit $R \to \infty$, we must take a discrete sequence $R_n = 2n\pi$ (say) and let $n \to \infty$.

Let $$f_n(\theta) = \left| \frac{n\pi e^{-(1-a)n\pi \cos\ \theta}}{e^{-n\pi\cos\theta} + e^{in\pi\sin\theta}}\right| = \frac{n\pi e^{-(1-a)n\pi\cos\theta}}{\sqrt{e^{-2n\pi\cos\theta} + 2e^{-n\pi\cos\theta}\cos(n\pi\sin\theta) + 1}}.$$ Then $f(\frac\pi 2) = \frac {n\pi}2$, so $\sup f_n(\theta)$ will not tend to zero; we need a tighter bound.

For $\theta < \pi/2$, the denominator tends to 1 as $n \to \infty$ and the numerator tends to zero. For $\theta > \pi/2$, the denominator tends to $e^{n\pi|\cos\theta|}$ so $f_n (\theta) \sim n\pi e^{-an\pi|\cos\theta|} \to 0$. So we should be able to find a bound of the form $$f_n(\theta) \leq \begin{cases} m_n & 0 \leq \theta < \frac 12(\pi - \epsilon_n) \\ \frac{n\pi}2 & \frac12 (\pi - \epsilon_n) \leq \theta \leq \frac 12(\pi + \epsilon_n) \\ m_n' & \frac12(\pi + \epsilon_n) < \theta \leq \pi\end{cases}$$ where $m_n$, $m_n'$ and $n\pi\epsilon_n$ all tend to zero as $n \to \infty$. Then $$\int_0^\pi f_n(\theta)\,d\theta \leq \frac{(m_n + m_n')(\pi - \epsilon_n)}{2} + \frac{n\pi}2 \epsilon_n \to 0.$$

Gold Member
Hi, @pasmith. Did you make slight typo? You said you where going to use ##R_n = 2n \pi##, but you seem to have plugged ##n \pi## into your formula instead.

Assuming you meant to plug in ## R_n = 2n \pi##, I think I have found a bound of the form you postulated...

Starting with

$$f_n (\theta) = \dfrac{2 n \pi e^{-(1-a) 2n \pi cos \theta}}{\sqrt{e^{-4n \pi cos \theta} + 2 e^{-2n \pi cos \theta} \cos \left( 2 n \pi \sin \theta \right) + 1}}$$

and using

\begin{align*}
\sin (\frac{\pi}{2} + \phi) = \sin \frac{\pi}{2} \cos \phi + \cos \frac{\pi}{2} \sin \phi = \cos \phi
\nonumber \\
\cos (\frac{\pi}{2} + \phi) = \cos \frac{\pi}{2} \cos \phi - \sin \frac{\pi}{2} \sin \phi = - \sin \phi
\end{align*}

we have

$$\frac{f_n (\frac{\pi}{2} + \phi)}{n \pi} = \dfrac{2 e^{(1-a) 2n \pi \sin \phi}}{\sqrt{e^{4n \pi \sin \phi} + 2 e^{2n \pi \sin \phi} \cos \left( 2 n \pi \cos \phi \right) + 1}} \qquad (*)$$

First assume ##\phi \geq 0##. For ##0 \leq \phi \leq \frac{\pi}{2}## we have ##\sin \phi \leq \phi## and ##\cos \phi \geq 1 - \frac{2}{\pi} \phi##. Note for ##\phi## close enough to ##0##,

\begin{align*}
\cos \left( 2 n \pi \cos \phi \right) & \geq \cos \left( 2 n \pi \left(1 - \frac{2}{\pi} \phi \right) \right)
\nonumber \\
& = \cos \left( 2 n \pi - 4 n \phi \right)
\nonumber \\
& = \cos \left( 4 n \phi \right)
\end{align*}

This inequality obviously holds on the interval ##[0, \frac{\pi}{8n}]## (at ##\phi = \frac{\pi}{8n}##, ##\cos \left( 4 n \phi \right)## becomes zero).

Using these inequalities in ##(*)##, we have

\begin{align*}
\frac{f_n (\frac{\pi}{2} + \phi)}{n \pi} & \leq \dfrac{2 e^{(1-a) 2n \pi \phi}}{\sqrt{1 + 2 \cos \left( 2 n \pi (1 - \frac{2}{\pi} \phi) \right) + 1}}
\nonumber \\
& = \dfrac{2 e^{(1-a) 2n \pi \phi}}{\sqrt{2 + 2 \cos \left( 4n \phi \right)}}
\end{align*}

while ##0 \leq \phi \leq \phi_{max} = \frac{\pi}{8n}##, with the RHS of this inequality monotonically increasing on ##[0,\frac{\pi}{8n}]##. And so

$$\frac{f_n (\frac{\pi}{2} + \phi)}{n \pi} \leq \sqrt{2} e^{(1-a) \pi^2 / 4}$$

while ##0 \leq \phi \leq \phi_{max} = \frac{\pi}{8n}##.

Now assume ##\phi \leq 0##. Write

\begin{align*}
\frac{f_n (\frac{\pi}{2} + \phi)}{n \pi} & = \dfrac{2 e^{-a 2n \pi \sin \phi}}{\sqrt{e^{-4n \pi \sin \phi} + 2 e^{-2n \pi \sin \phi} \cos \left( 2 n \pi \cos \phi \right) + 1}}
\nonumber \\
& = \dfrac{2 e^{a 2n \pi |\sin \phi|}}{\sqrt{e^{4n \pi |\sin \phi|} + 2 e^{2n \pi |\sin \phi|} \cos \left( 2 n \pi \cos \phi \right) + 1}}
\end{align*}

By similar reasoning, we have

$$\frac{f_n (\frac{\pi}{2} + \phi)}{n \pi} \leq \sqrt{2} e^{a \pi^2 / 4}$$

while ##- \frac{\pi}{8n} = - \phi_{max} \leq \phi \leq 0##.

Put

$$M = max \left( \sqrt{2} e^{(1-a) \pi^2 / 4} , \sqrt{2} e^{a \pi^2 / 4} \right)$$

we have for ##\frac{1}{2} \epsilon_n \leq \phi_{max} = \frac{\pi}{8n}##,

$$f_n (\theta) \leq \left\{ \begin{matrix} m_n & 0 \leq \theta < \frac{1}{2} \left( \pi - \epsilon_n \right) \\ n \pi M & \frac{1}{2} \left( \pi - \epsilon_n \right) \leq \theta \leq \frac{1}{2} \left( \pi + \epsilon_n \right) \\ m_n' & \frac{1}{2} \left( \pi + \epsilon_n \right) < \theta \leq \pi \end{matrix} \right.$$

We choose:

$$\epsilon_n = \frac{\pi}{4 n^2}$$

so that

$$n \pi M \epsilon_n \rightarrow 0 .$$

Last edited:
Gold Member
Hang on, I don't think it works. Because then we couldn't have ##m_n, m_n' \rightarrow 0##.

Generally, not sure it can work. If we want

$$n \pi M \epsilon_n \rightarrow 0$$

then we need ##\epsilon_n = \frac{C}{n^\beta}## with ##\beta > 1##. But then

\begin{align*}
f_n ( \frac{\pi}{2} - \frac{C}{2n^\beta}) & =
\dfrac{2 n \pi e^{-(1-a) 2n \pi \cos( \frac{\pi}{2} - \frac{C}{2n^\beta})}}{\sqrt{e^{-4n \pi \cos (\frac{\pi}{2} - \frac{C}{2n^\beta})} + 2 e^{-2n \pi \cos (\frac{\pi}{2} - \frac{C}{2n^\beta})} \cos \left( 2 n \pi \sin (\frac{\pi}{2} - \frac{C}{2n^\beta}) \right) + 1}}
\nonumber \\
& = \dfrac{2 n \pi e^{-(1-a) 2n \pi \sin (\frac{C}{2n^\beta})}}{\sqrt{e^{-4n \pi \sin (\frac{C}{2n^\beta})} + 2 e^{-2n \pi \sin (\frac{C}{2n^\beta})} \cos \left( 2 n \pi \cos (\frac{C}{2n^\beta}) \right) + 1}}
\nonumber \\
& \rightarrow \dfrac{2 n \pi e^{-(1-a) \pi \frac{C}{n^{\beta - 1}}}}{\sqrt{e^{-2 \pi \frac{C}{n^{\beta - 1}}} + 2 e^{- \pi \frac{C}{n^{\beta} - 1}} + 1}}
\nonumber \\
& \rightarrow \infty
\end{align*}

Last edited:
Gold Member
Seeing as I had already given an answer in post #3, I gave a suggestion as how to evaluate the integral via another method in post #4 (the third suggestion). Seeing as the two weeks are nearly up, I'll post how to do it this other way:

First use the substitution ##u = e^x## and obtain

$$I = \int_{-\infty}^\infty \frac{e^{a x}}{1 + e^x} dx = \int_0^\infty \frac{u^{a-1}}{1+u} du$$

This ##u## integral can be evaluated via a contour integral. First note that the function

$$f(z) = \frac{z^{a-1}}{1+z}$$

has a branch point at ##z=0##. We take the branch line to be the positive real axis. We employ the contour integral shown in the figure. We integrate along the positive real axis just above the branch cut, then around a large circle, then along the positive real axis in the negative direction just below the cut, but on the same branch, and then around a small circle.

Just below the cut, but on the same branch, we have

$$\frac{(e^{i 2 \pi} u)^{a-1} }{1+e^{i 2 \pi} u} = e^{i 2 \pi (a-1)} \frac{u^{a-1}}{1+u} = e^{i 2 \pi a} \frac{u^{a-1}}{1+u}$$

For the integration around a small circle around the origin put ##z = \epsilon e^{i \theta}##, then

\begin{align*}
\left| \int_0^{2 \pi} \frac{\epsilon^a e^{i \theta a} i}{1 + \epsilon e^{i \theta}} d \theta \right| & \leq \epsilon^a \int_0^{2 \pi} \frac{d \theta}{\sqrt{\epsilon^2 + 2 \epsilon \cos \theta + 1}}
\nonumber \\
& \leq \epsilon^a \int_0^{2 \pi} \frac{d \theta}{\sqrt{\epsilon^2 - 2 \epsilon + 1}}
\nonumber \\
& = 2 \pi \epsilon^a \frac{1}{1 - \epsilon} \rightarrow 0 \quad \text{as} \; \epsilon \rightarrow 0
\end{align*}

For integration around circle of large radius put ##z = R e^{i \theta}##, then

\begin{align*}
\left| \int_0^{2 \pi} \frac{R^a e^{i \theta a} i}{1 + R e^{i \theta}} d \theta \right| & \leq \int_0^{2 \pi} \frac{R^{a-1} d \theta}{\sqrt{R^{-2} + 2 R^{-1} \cos \theta + 1}}
\nonumber \\
& \leq \int_0^{2 \pi} \frac{R^{a-1} d \theta}{\sqrt{R^{-2} - 2 R^{-1} + 1}}
\nonumber \\
& = 2 \pi \frac{R^{a-1}}{1 - R^{-1}} \rightarrow 0 \quad \text{as} \; R \rightarrow \infty
\end{align*}

Therefore,

$$\oint \frac{z^{a-1}}{1+z} = \int_0^\infty \frac{u^{a-1}}{1+u} du - e^{i 2 \pi a} \int_0^\infty \frac{u^{a-1}}{1+u} du$$

The function ##f(z)## has a simple pole at ##z=-1##, so that

$$\oint \frac{z^{a-1}}{1+z} =2 \pi i (e^{i \pi})^{(a-1)} = - 2 \pi i e^{i \pi a} .$$

Combining the above gives

$$(1 - e^{i 2 \pi a}) \int_0^\infty \frac{u^{a-1}}{1+u} du = - 2 \pi i e^{i \pi a}$$

or

$$\int_0^\infty \frac{u^{a-1}}{1+u} du = \frac{\pi}{\sin a \pi} .$$

Euge