## Evaluate the Integral $$\int \frac{x}{\mathrm{e}^{x}-1} dx$$

This question was posed at Mathematics Stack Exchange, here is my solution.

I = \int \frac{x}{\mathrm{e}^{x}-1} dx = -I_{1} = -\int \frac{x}{1-\mathrm{e}^{x}} dx

Integrate by parts
\begin{align}
I_{1} &= \int \frac{x}{1-\mathrm{e}^{x}} dx \\
\tag{1}
&= x^{2} – x \ln(1-\mathrm{e}^{x}) – \int x dx + \int \ln(1-\mathrm{e}^{x}) dx \\
\tag{2}
&= x^{2} – x \ln(1-\mathrm{e}^{x}) – \frac{x^{2}}{2} – \mathrm{Li}_{2}(\mathrm{e}^{x})
\end{align}
and thus

\int \frac{x}{\mathrm{e}^{x}-1} dx = x \ln(1-\mathrm{e}^{x}) – \frac{x^{2}}{2} + \mathrm{Li}_{2}(\mathrm{e}^{x})

1. Let $$u=\mathrm{e}^{x}$$
\begin{align}
\int \frac{1}{1-\mathrm{e}^{x}} dx &= \int \frac{1}{u(1-u)} du \\
&= \int \left( \frac{1}{u} + \frac{1}{1-u} \right) du \\
&= \ln \frac{u}{1-u} \\
&= x – \ln(1-\mathrm{e}^{x})
\end{align}

2. Let $$u=\mathrm{e}^{x}$$
\begin{align}
\int \ln(1-\mathrm{e}^{x}) dx &= \int \frac{\ln(1-u)}{u} du \\
&= -\mathrm{Li}_{2}(u) \\
&= -\mathrm{Li}_{2}(\mathrm{e}^{x})
\end{align}
where

\mathrm{Li}_{2}(z) = -\int\limits_{0}^{z} \frac{\ln(1-x)}{x} dx

is the dilogarithm function.

## Evaluate the Integral $$\int \frac{1}{x^{n}(T-x)^{n}} dx$$

This question was posed at Mathematics Stack Exchange, here is my solution.

For $$n \in \mathbb{N}$$.

\begin{align}
\int \frac{1}{x^{n}(T-x)^{n}} dx &= \frac{1}{T^{n}} \int \frac{1}{x^{n}(1-x/T)^{n}} dx \\
&= T^{1-2n} \int y^{-n} (1-y)^{-n} dy \\
&= T^{1-2n} \mathrm{B}_{y}(1-n,1-n) \\
&= T^{1-2n} \mathrm{B}_{x/T}(1-n,1-n) \\
&= \frac{1}{1-n} \frac{x^{1-n}}{T^{n}} {}_{2}\mathrm{F}_{1}(1-n,n;2-n;x/T)
\end{align}

We have used the incomplete Beta function and Gauss’s hypergeometric function.

## For What Values of $$p$$ does $$\int_{1}^{\infty} \frac{1}{x^{2} \sqrt{x^{p}-1}} dx$$ Converge?

This was a question posed at Mathematics Stack Exchange. The obvious solutions were posted before I saw the question so this is an alternative solution that is interesting yet inefficient.

Let $$y=1/x$$, then $$z=y^{-p}-1$$
\begin{align}
\int\limits_{1}^{\infty} \frac{1}{x^{2} \sqrt{x^{p}-1}} dx &= \int\limits_{0}^{1} \frac{1}{\sqrt{y^{-p}-1}} dy \\
&= \frac{1}{p} \int\limits_{0}^{\infty} \frac{z^{-1/2}}{(z+1)^{1+1/p}} dz \\
&= \frac{1}{p} \mathrm{B}\left(\frac{1}{2},\frac{1}{p} + \frac{1}{2} \right) \\
&= \frac{\sqrt{\pi}\Gamma \left( \frac{1}{p} + \frac{1}{2} \right)}{\Gamma \left( \frac{1}{p} \right)}
\end{align}

The integrand and the limits of integration require that $$p \gt 0$$. From the
beta function we have $$\mathrm{Re} (\frac{1}{p} + \frac{1}{2}) \gt 0$$, $$p \lt -2$$ and $$p \gt 0$$. Thus we
must have $$p \gt 0$$.

We have used the following integral definition of the beta function

\mathrm{B}(x+1,y+1) = \int\limits_{0}^{\infty} \frac{z^{x}}{(1+z)^{x+y+2}} dz

## Prove $$\int_{0}^{1} (1-x^{1/k})^{n} dx = {1\over {k+n\choose n}}$$

How to prove

\int\limits_{0}^{1} (1-x^{1/k})^{n} dx = {1\over {k+n\choose n}}

was a question posed at Mathematics Stack Exchange. Here is my solution.

Let $$y=x^{1/k}$$
\begin{align}
\int\limits_{0}^{1} (1-x^{1/k})^{n} dx &= k\int\limits_{0}^{1} (1-y)^{n} y^{k-1} dy \\
&= k\, \mathrm{B}(k,n+1) \\
&= \frac{k\,\Gamma(k)\Gamma(n+1)}{\Gamma(k+n+1)} \\
&= \frac{k!n!}{(k+n)!} \\
&= {1\over {k+n\choose n}}
\end{align}

## Evaluate the Integral $$\int_{1}^{x} \frac{dt}{\sqrt{t^{3}-1}}$$

How to evalute

\int\limits_{1}^{x} \frac{dt}{\sqrt{t^{3}-1}}

was a question posed at Mathematics Stack Exchange. Here is my solution

The integral is of the form of the polynomial under the radical having 1 real and 2 complex roots and the lower limit of integration equal to the real root. So we have

\int\limits_{a}^{x} \left( (t-a)[(t-r)^{2} + s^{2}] \right)^{-1/2}\, dt
= \frac{1}{\sqrt{m}} \mathrm{cn}^{-1}\left(\frac{m-(t-a)}{m+(t-a)},k \right)

where

m^{2} = (r – a)^{2} + s^{2} \quad \mathrm{and} \quad k^{2} = \frac{1}{2} – \frac{a-r}{2m}

$$\mathrm{cn}^{-1}z$$ is the inverse of one of the Jacobi elliptic functions and $$k$$ is the modulus.

To factor the polynomial inside of the radical, we note that the roots are the cube roots of 1, thus
\begin{align}
t^{3}-1 &= (t-t_{1})(t-t_{2})(t-t_{3}) \\
&= (t-1) \left(\Big[t+\frac{1}{2}\Big]-i\frac{\sqrt{3}}{2} \right) \left(\Big[t+\frac{1}{2}\Big]+i\frac{\sqrt{3}}{2} \right) \\
&= (t-1) \left(\Big[t+\frac{1}{2}\Big]^{2} + \frac{3}{4}\right)
\end{align}

We now have

and thus

\int\limits_{1}^{x} \frac{dt}{\sqrt{t^{3}-1}}
= 3^{-1/4} \mathrm{cn}^{-1}\left(\frac{\sqrt{3} + 1 – x}{\sqrt{3} – 1 + x},\sqrt{\frac{1}{2} – \frac{3}{4\sqrt{3}}} \right)

## Evaluate the Integral $$\int x^{2} \mathrm{e}^{-x^{2}} dx$$

How to evaluate

\int x^{2} \mathrm{e}^{-x^{2}} dx

was a question posed at Mathematics Stack Exchange. Here is my solution

Integrate by parts

\int x^{2} \mathrm{e}^{-x^{2}} dx = \frac{1}{2} \sqrt{\pi} x^{2} \mathrm{erf}(x) – \sqrt{\pi} \int x \, \mathrm{erf}(x) dx

Integrate by parts again
\begin{align}
\int x \,\mathrm{erf}(x) dx
&= x^{2} \mathrm{erf}(x) + \frac{1}{\sqrt{\pi}} x \mathrm{e}^{-x^{2}}
– \int x \,\mathrm{erf}(x) dx – \frac{1}{\sqrt{\pi}} \int \mathrm{e}^{-x^{2}} dx \\
&= x^{2} \mathrm{erf}(x) + \frac{1}{\sqrt{\pi}} x \,\mathrm{e}^{-x^{2}}
– \int x \mathrm{erf}(x) dx – \frac{1}{2} \mathrm{erf}(x) \\
&= \frac{1}{2} x^{2} \mathrm{erf}(x) + \frac{1}{2\sqrt{\pi}} x \mathrm{e}^{-x^{2}}
– \frac{1}{4} \mathrm{erf}(x)
\end{align}

Thus we have

\int x^{2} \mathrm{e}^{-x^{2}} dx = \frac{\sqrt{\pi}}{4} \mathrm{erf}(x) – \frac{1}{2} x \mathrm{e}^{-x^{2}}

## Evaluate the Integral $$\int_{0}^{1} \mathrm{e}^{-x^{4}} (1-x^{4}) dx$$

How to evaluate

\int\limits_{0}^{1} \mathrm{e}^{-x^{4}} (1-x^{4}) dx

was a question posed at Mathematics Stack Exchange. Here is my solution.

Let $$y=x^{4}$$

\int\limits_{0}^{1} \mathrm{e}^{-x^{4}} dx = \frac{1}{4} \int\limits_{0}^{1} \mathrm{e}^{-y} y^{-3/4} dy
= \frac{1}{4} \gamma\left(\frac{1}{4},1 \right)

Using the same substitution, we also have

\int\limits_{0}^{1} \mathrm{e}^{-x^{4}} x^{4} dx = \frac{1}{4} \int\limits_{0}^{1} \mathrm{e}^{-y} y^{1/4} dy
= \frac{1}{4} \gamma\left(\frac{5}{4},1 \right)

Thus we obtain

\int\limits_{0}^{1} \mathrm{e}^{-x^{4}} (1-x^{4}) dx
= \frac{1}{4} \Big[ \gamma\left(\frac{1}{4},1 \right) – \gamma\left(\frac{5}{4},1 \right) \Big]
\approx 0.7256

We have used the lower incomplete gamma function:

\gamma(s,z) = \int\limits_{0}^{z} \mathrm{e}^{-x} x^{s-1} dx

## Prove $$\int_{-\infty}^{\infty} \mathrm{e}^{ist^{2}} dt = \mathrm{e}^{is\pi /4}\sqrt{\pi}$$ for $$s = \pm 1$$

First integral, for $$s=1$$
\begin{align}
2\int \mathrm{e}^{it^{2}} dt &= 2\frac{1}{\sqrt{i}} \int \mathrm{e}^{x^{2}} dx \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erfi}(x) \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erfi}(t\sqrt{i})
\end{align}

Thus
\begin{align}
2\int\limits_{0}^{\infty} \mathrm{e}^{it^{2}} dt &= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erfi}(t\sqrt{i}) \Big|_{0}^{\infty} \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} (i-0) = \sqrt{i}\sqrt{\pi} = \mathrm{e}^{i\pi /4}\sqrt{\pi}
\end{align}

Second integral, for $$s=-1$$
\begin{align}
2\int \mathrm{e}^{-it^{2}} dt &= 2\frac{1}{\sqrt{i}} \int \mathrm{e}^{-x^{2}} dx \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erf}(x) \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erf}(t\sqrt{i})
\end{align}

Thus
\begin{align}
2\int\limits_{0}^{\infty} \mathrm{e}^{-it^{2}} dt &= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erf}(t\sqrt{i}) \Big|_{0}^{\infty} \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} (1-0) = \frac{1}{\sqrt{i}} \sqrt{\pi} = \mathrm{e}^{-i\pi /4}\sqrt{\pi}
\end{align}

And we have

\int\limits_{-\infty}^{\infty} \mathrm{e}^{ist^{2}} dt = \mathrm{e}^{is\pi /4}\sqrt{\pi}

for $$s = \pm 1$$

## Evaluate the Integral $$\int_{0}^{1} \frac{1}{1-\log_{2}x} dx$$

How to evaluate

\int\limits_{0}^{1} \frac{1}{1-\log_{2}x} dx

was a question posed at Mathematics Stack Exchange. Here is my solution.

Make successive substitutions $$z=1-\frac{\ln x}{\ln2}, \,y=z\ln2$$

\begin{align}
\int\limits_{0}^{1} \frac{1}{1-\log_{2}x} dx &= 2\ln2 \int\limits_{1}^{\infty} \frac{1}{z} \mathrm{e}^{-z\ln2} dz \\
&= 2\ln2 \int\limits_{\ln2}^{\infty} \frac{\mathrm{e}^{-y}}{y} dy \\
&=-(2\ln2)\mathrm{Ei}(-\ln2) \approx 0.52495
\end{align}

\mathrm{Ei}(z) = -\int\limits_{-z}^{\infty} \frac{\mathrm{e}^{-t}}{t} dt

is the exponential integral function.

## Prove $$\lim_{n \to \infty} \int_{0}^{1} \frac{x^{n}}{\sqrt{1+x^{n}}} dx = 0$$

How to prove

\lim_{n \to \infty} \int\limits_{0}^{1} \frac{x^{n}}{\sqrt{1+x^{n}}} dx = 0

was a question posed at Mathematics Stack Exchange. There are more efficient answers there, but here is a fun and interesting solution.

Using the integral defintion (analytically continued) of Gauss’s hypergeometric function

{}_{2}\mathrm{F}_{1}(a,b;c;z) = \frac{\Gamma(c)}{\Gamma(b)\Gamma(c-b)} \int\limits_{0}^{1} t^{a-1} (1-t)^{c-b-1} (1-zt)^{-a} dt

for $$\mathrm{Re}\,c \gt \mathrm{Re}\,b \gt 0,\,\,|\mathrm{arg}(1-z)| \lt \pi$$

We have, using the substitution $$y=x^{n}$$
\begin{align}
\int\limits_{0}^{1} \frac{x^{n}}{\sqrt{1+x^{n}}} dx
&= \frac{1}{n} \int\limits_{0}^{1} \frac{y^{1/n}}{\sqrt{1+y}} dy \\
\tag{1}
&= \frac{\Gamma(1+1/n)\Gamma(1)}{n\Gamma(2+1/n)} \,{}_{2}\mathrm{F}_{1}\left(\frac{1}{2},1+\frac{1}{n};2+\frac{1}{n};-1 \right) \\
&= \frac{1}{n+1} \,{}_{2}\mathrm{F}_{1}\left(\frac{1}{2},1+\frac{1}{n};2+\frac{1}{n};-1 \right)
\end{align}

Taking the limit of the hypergeometric function and applying the integral definition again yields
\begin{align}
\lim_{n \to \infty} {}_{2}\mathrm{F}_{1}\left(\frac{1}{2},1+\frac{1}{n};2+\frac{1}{n};-1 \right)
&= {}_{2}\mathrm{F}_{1}\left(\frac{1}{2},1;2;-1 \right) \\
&= \frac{\Gamma(2)}{\Gamma(1)\Gamma(1)} \int\limits_{0}^{1} \frac{1}{\sqrt{1+t}} dt \\
&= 2(\sqrt{2} – 1)
\end{align}

Substituting this result into equation 1, we have

\lim_{n \to \infty} \int\limits_{0}^{1} \frac{x^{n}}{\sqrt{1+x^{n}}} dx = 0*2(\sqrt{2} – 1) = 0