---
# System prepended metadata

title: Integration Bee Round 1

---

# Integration Bee Round 1

[toc]

## [✓] 1. Shift:

$$
\int_0^1 \frac{1}{\sqrt{x - x^2}} dx \stackrel{u = x - \frac{1}{2}}{=} \int_{-1/2}^{1/2} \frac{1}{\sqrt{\frac{1}{4} - u^2}} du \stackrel{u=\frac{1}{2}\sin\theta}{=} \int_{\pi/2}^{-\pi/2} du = \pi
$$

## [✓] 2. Endpoints don't matter.

$$
\int_0^{100} \lceil x\rceil \lfloor x\rfloor dx = \sum_{k=0}^{99} k\underbrace{(k + 1)}_{\lceil x\rceil, x \in (k, k + 1)} = \sum_{k=1}^{99} k^2 + k = \cdots = 333300
$$

## [✓] 3. Reflection:

\begin{align*}
I
&= \int_0^{\pi} \cos(x + \cos(x)) dx \\
&= \int_0^{\pi} \cos(\pi - x - \cos(x)) dx & x = \pi - x \\
&= -\int_0^{\pi} \cos(x + \cos(x)) dx & \cos(\pi - x) = -\cos(x) \\
&= -I \\\\
\implies I &= 0
\end{align*}

## [✓] 4. Nested roots

$$
y = \sqrt{x + \sqrt{x + \sqrt{x + \cdots}}} = \sqrt{x + y}
\implies y = \frac{1 + \sqrt{1 + 4x}}{2}
$$

$$
\int_0^1 y dx = \frac{1}{2} + \frac{1}{2} \int_0^1 \sqrt{1 + 4x} dx = \frac{1}{2} + \frac{1}{2} \cdot \frac{1}{4} \cdot \frac{2}{3} \cdot (\sqrt{5} - 1) = \frac{5}{12} + \frac{1}{12}\sqrt{5}
$$

## [✓] 5. Fractions:

\begin{align*}
&\int_0^1 \frac{1}{x} - \lfloor\frac{1}{x}\rfloor dx \\
&= \int_1^{\infty} \frac{u - \lfloor u\rfloor}{u^2} du & u = \frac{1}{x} \\
&= \sum_{k=1}^{\infty} \int_k^{k+1} \frac{u - k}{u^2} du \\
&= \sum_{k=1}^{\infty} \log(k + 1) - \log(k) - \frac{1}{k + 1} \\
&= \lim_{N\to\infty} \log(N + 1) - \sum_{k=1}^{N} \frac{1}{k + 1} \\
&= \lim_{N\to\infty} -\left(H_{N + 1} - \log(N + 1) - 1\right) \\
&= 1 - \gamma
\end{align*}

## [✓] 6. Trig:

$$
\tan^{-1}(x) + \cot^{-1}(x) = \frac{\pi}{2}
\implies \int_0^1 \frac{\tan^{-1}x + \cot^{-1}x}{x^2 + 1}dx = \frac{\pi}{2} \cdot \frac{\pi}{4} = \frac{\pi^2}{8}
$$

## [✓] 7. Trig:

\begin{align*}
&\prod_{i=1}^N \cos\left(\frac{x}{2^i}\right) \\
&= \frac{\cos(x / 2)\cos(x / 4)\cdots\color{red}{\cos(x / 2^N)\sin(x / 2^N)}}{\sin(x / 2^N)} \\
&= \frac{1}{2}\frac{\cos(x / 2)\cdots\color{red}{\cos(x / 2^{N - 1})\sin(x / 2^{N - 1})}}{\sin(x / 2^N)} \\
&= \cdots \\
&= \frac{1}{2^N}\frac{\cos(x)}{\sin(x / 2^N)}
\end{align*}

$$
\int_0^{\pi/2} x\prod_{i=1}^{\infty}\cos\left(\frac{x}{2^i}\right) dx = \int_0^{\pi/2} \lim_{N\to\infty} \cos(x) \cdot \frac{x/2^N}{\sin(x/2^N)} dx = \int_0^{\pi/2} \cos(x) dx = 1
$$

## [✓] 8. Trig:

\begin{align*}
&\int_0^{\pi/4} \log(\cot x - 1) dx \\
&= \int_0^{\pi/4} \log(\cos x - \sin x) - \log(\sin x) dx \\
&= \int_0^{\pi/4} \log\left(\sqrt{2}\cos\left(x + \frac{\pi}{4}\right)\right) - \int_0^{\pi/4} \log(\sin x) dx \\
&= \frac{\pi}{8}\log 2 + \int_{\pi/4}^{\pi/2} \log(\cos x) dx - \int_0^{\pi/4} \log(\sin x) dx \\
&= \frac{\pi}{8}\log 2 & x = \frac{\pi}{2} - x
\end{align*}

## [✓] 9. DUTIS:

\begin{align*}
I(b) &= \int_0^{\pi/2} \frac{\tan^{-1}(b\sin x)}{\sin x} dx, I(0) = 0 \\\\
\implies \frac{\partial I}{\partial b} &= \int_0^{\pi/2} \frac{1}{1 + b^2\sin^2 x} dx \\
&= \int_0^{\pi/2} \frac{\sec^2 x}{\sec^2 x + b^2\tan^2 x} dx \\
&= \int_0^{\infty} \frac{1}{(1 + t^2) + b^2t^2} dt & t = \tan x \\
&= \int_0^{\infty} \frac{1}{1 + (b^2 + 1)t^2} dt \\
&= \frac{1}{b^2 + 1}\cdot\left[\arctan(t)\right]_0^{\infty} \\
&= \frac{\pi}{2(b^2 + 1)} \\\\
\implies I(b) &= \frac{\pi}{2}\arctan(b)
\end{align*}

## [✓] 10. Series:

\begin{align*}
&\int_0^{\infty} \frac{x^3}{e^x + 1} dx \\
&= \int_0^{\infty} \frac{x^3e^{-x}}{1 + e^{-x}} dx \\
&= \sum_{k=0}^{\infty} (-1)^k \int_0^{\infty} x^3e^{-(k + 1)x} dx \\
&= \sum_{k=0}^{\infty} (-1)^k \left[\left(-\frac{x^3}{k + 1} - \frac{3x^2}{(k + 1)^2} - \frac{6x}{(k + 1)^3} + \frac{6}{(k + 1)^4}\right)e^{-(k + 1)x}\right]_0^1 \\
&= 6\sum_{k=1}^{\infty} \frac{(-1)^k}{k^4} \\
&= 6\left(\zeta(4) - 2^{-4}\zeta(4)\right) \\
&= 6 \cdot \frac{15}{16} \cdot \frac{\pi^4}{90} \\
&= \frac{7}{120} \pi^4
\end{align*}

## [✓] 11. Catalan Numbers:

Note that

$$
\sum_{n=0}^{\infty} \int\binom{2n}{n} x^n dx = \sum_{n=0}^{\infty} \frac{1}{n + 1}\binom{2n}{n} x^{n + 1}
$$

Is the (shifted) generating function for the Catalan numbers, which has the closed form $\frac{1}{2}(1 - \sqrt{1 - 4x})$. Therefore,

$$
\int_0^{1/4} \sum_{n=0}^{\infty} \binom{2n}{n}x^n dx = \left[\frac{1}{2}(1 - \sqrt{1 - 4x})\right]_0^{1/4} = \frac{1}{2}
$$

## [✓] 12. Complex Trig:

$$
\int_0^{\infty} \cos(x^2) dx = \Re\int_0^{\infty} e^{ix^2} dx
$$

Let $x = \exp(\pi i / 4)y$. Then $x^2 = iy^2$ and

$$
\int_0^{\infty} \cos(x^2)dx = \Re\int_0^{\infty} e^{-y^2} \exp\left(\frac{\pi i}{4}\right) dy = \frac{\sqrt{\pi}}{2}\cdot\frac{1}{\sqrt{2}} = \sqrt{\frac{\pi}{8}}
$$

## [✓] 13. Reflection + Series:

$$
I = \int_0^{\infty} \frac{\log x}{1 - x^2} dx = \int_0^1 \frac{\log x}{1 - x^2} dx + \int_1^{\infty} \frac{\log x}{1 - x^2} dx = I_1 + I_2
$$

Now reflecting,

$$
I_2 \stackrel{t = \frac{1}{x}}{=} \int_0^1 \frac{\log \frac{1}{t}}{1 - \frac{1}{t^2}} \frac{1}{t^2} dt = \int_0^1 \frac{\log t}{1 - t^2} = I_1
$$

Therefore,

\begin{align*}
I
&= 2I_1 \\
&= 2\sum_{k=0}^{\infty} \int_0^1 x^{2k}\log x dx \\
&= 2\sum_{k=0}^{\infty} \left[\frac{1}{2k + 1}x^{2k + 1}\log x - \frac{x^{2k + 1}}{(2k + 1)^2}\right]_0^1 \\
&= -2\sum_{k=0}^{\infty} \frac{1}{(2k + 1)^2} \\
&= -2\cdot\frac{\pi^2}{8} \\
&= -\frac{\pi^2}{4}
\end{align*}

## [✓] 14. Trig

$$
\int_0^{\pi/2} \log(\sin x)\sec^2 x dx = \log(\sin x)\tan x\Big|_0^{\pi/2} - \int_0^{\pi/2} \frac{\cos x}{\sin x}\tan x dx = -\frac{\pi}{2}
$$

## [✓] 15. Trig

**NOTICE (OR USE YOUR BRAIN)** THAT $\frac{d}{dx}\left(\frac{\sin x}{1 + \cos x + \sin x}\right) = \frac{c(1 + c + s) - s(c - s)}{(1 + c + s)^2} = \frac{1 + \cos x}{(1 + \cos x + \sin x)^2}$. Therefore, writing $c = \cos x$, $c(2) = \cos(2x)$ and $s = \sin x$, we have

\begin{align*}
I
&=\int_0^{\pi/2} \frac{c^2(1 + c)}{(1 + c + s)^2} dx \\
&= \left[c^2 x \cdot \frac{s}{1 + c + s}\right]_0^{\pi/2} - \int_0^{\pi/2} \frac{(-2sc)s}{1 + c + s} dx \\
&= 2\int_0^{\pi/2} \frac{s^2 c}{1 + c + s} dx
\end{align*}

Now, what follows might not be the most elegant way, but it works. T-sub, with $t = \tan\left(\frac{x}{2}\right)$.

\begin{align*}
I
&= \int_0^1 \frac{\left(\frac{2t}{1 + t^2}\right)^2\left(\frac{1 - t^2}{1 + t^2}\right)}{1 + \frac{2t}{1 + t^2} + \frac{1 - t^2}{1 + t^2}}\cdot\frac{2}{1 + t^2} dt \\
&= \int_0^1 \frac{8t^2(1 - t^2)}{(1 + t)(1 + t^2)^3} dt \\
&= \int_0^1 \frac{8t^2 - 8t^3}{(1 + t^2)^3} dt \\
&= 8I_1 - 8I_2
\end{align*}

Hope you know how to integrate rational functions.

\begin{align*}
I_1
&= \int_0^1 \frac{t^2}{(1 + t^2)^3} dt \\
&= \int_0^{\pi/4} \frac{\tan^2 u}{\sec^4 u} du & t = \tan u\\
&= \frac{1}{4} \int_0^{\pi/4} \sin^2(2u) du \\
&= \frac{1}{8} \int_0^{\pi/2} \sin^2(u) du \\
&= \frac{\pi}{32} \\\\
I_2
&= \int_0^1 \frac{t^3}{(1 + t^2)^3} dt \\
&= \frac{1}{2} \int_1^2 \frac{u - 1}{u^3} du & u = 1 + t^2 \\
&= \frac{1}{2}\left[-\frac{1}{u} + \frac{1}{2u^2}\right]_1^2 \\
&= \frac{1}{2}\left(\frac{1}{2} - \frac{3}{8}\right) \\
&= \frac{1}{16}
\end{align*}

Therefore,

$$
I = \frac{\pi}{4} - \frac{1}{2}
$$

## [✓] 16. Fractions

Same as 5. $1 - \gamma$.

## [ ] 17. ?

?

## [✓] 18. TOTAL BULLSHIT

First, split into two integrals

$$
\int_0^{\infty} \frac{\log(x + 1)}{x^2 + 1} dx = \int_0^1 \frac{\log(x + 1)}{x^2 + 1} dx + \int_1^{\infty} \frac{\log(x + 1)}{x^2 + 1} dx = I_1 + I_2
$$

Then reflect $I_2$:

\begin{align*}
I_2
&\stackrel{t = \frac{1}{x}}{=} \int_0^1 \frac{\log\left(\frac{1}{t} + 1\right)}{\frac{1}{t^2} + 1} \frac{1}{t^2} dt \\
&= \int_0^1 \frac{\log(1 + t) - \log(t)}{t^2 + 1} dt \\
&= I_1 - I_3
\end{align*}

Now, $I_3$ is standard.

$$
\int_0^1 \frac{\log(x)}{x^2 + 1} dx = \sum_{k=0}^{\infty} (-1)^k \int_0^1 x^{2k}\log x dx = -\sum_{k=0}^{\infty} \frac{(-1)^k}{(2k + 1)^2} = -G
$$

Next, we evaluate $I_1$. Let $I_1(a) = \int_0^1 \frac{\log(ax + 1)}{x^2 + 1} dx$.

\begin{align*}
\frac{\partial I_1}{\partial a}
&= \int_0^1 \frac{x}{ax + 1} \cdot \frac{1}{x^2 + 1} dx \\
&= \int_0^1 \frac{A}{ax + 1} + \frac{Bx + C}{x^2 + 1} dx \\
&= \cdots \\
&= \int_0^1 \frac{-a / (a^2 + 1)}{ax + 1} + \frac{(x - a) / (a^2 + 1)}{x^2 + 1} dx \\
&= \frac{1}{a^2 + 1} \left[-\log(ax + 1) + \frac{1}{2}\log(x^2 + 1) - a\tan^{-1}(x)\right]_0^1 \\
&= \frac{1}{a^2 + 1} \left(-\log(a + 1) + \frac{1}{2}\log 2 - \frac{\pi}{4}\right) \\
I_1(a)
&= -\int_0^1 \frac{\log(a + 1)}{a^2 + 1} da + \frac{1}{2}\log 2 \tan^{-1}(a) + \frac{\pi}{8} \log(a^2 + 1) \\
&= -I_1(1) + \frac{1}{2}\log 2 \tan^{-1}(a) + \frac{\pi}{8} \log(a^2 + 1) \\
I_1(1)
&= \frac{\pi}{8}\log 2
\end{align*}

Therefore,

$$
I = \frac{\pi}{4}\log 2 + G
$$

## [✓] 19. Series, Catalan Numbers

*Remark: Derived completely on my own.*

Firstly, write $c = \cos x$. Then,

\begin{align*}
I &= \int_0^{\pi} \sec x \log\left(1 + \frac{\cos x}{3}\right) dx \\
&= -\int_0^{\pi} \frac{1}{\cos x} \sum_{k=1}^{\infty} \frac{(-1)^k \left(\frac{\cos x}{3}\right)^k}{k} \\
&= -\sum_{k=1}^{\infty} \frac{(-1)^k}{k3^k} \int_0^{\pi} \cos^{k - 1} x\, dx
\end{align*}

Now, recall that $\int_0^{\pi} \cos^{2k + 1} x\, dx = 0$ by symmetry and

\begin{align*}
\int_0^{\pi} \cos^{2k} x\, dx
&= \frac{1}{2^{2n}} \int_0^{\pi} \sum_{k=0}^{2n} \binom{2n}{k} (e^{ix})^k (e^{-ix})^{2n - k} dx \\
&= \frac{1}{2^{2n}} \sum_{k=0}^{2n} \binom{2n}{k} \int_0^{\pi} e^{(2k - 2n)ix} dx
\end{align*}

Note that the integral is $0$ when $k \neq n$, since $k$ and $n$ are integers and symmetry. Therefore,

$$
\int_0^{\pi} \cos^{2k} x\, dx = \frac{\pi}{4^n} \binom{2n}{n}
$$

This means

\begin{align*}
I
&= \sum_{k=0}^{\infty} \frac{1}{(2k + 1)3^{2k + 1}} \int_0^{\pi} \cos^{2k} x\, dx \\
&= \frac{\pi}{3} \sum_{k=0}^{\infty} \frac{1}{2k + 1}\binom{2k}{k} \cdot \left(\frac{1}{36}\right)^k
\end{align*}

This looks suspiciously similar to question 11. We shall manipulate the generating function of Catalan numbers $C_n = \frac{1}{n + 1}\binom{2n}{n}$ to our new numbers $D_n = \frac{1}{2n + 1}\binom{2n}{n}$.

Define $F(x) = \sum_{k=0}^{\infty} C_k x^k$. From before, we know $F(x) = \frac{1 - \sqrt{1 - 4x}}{2x}$. Then,

\begin{array}{lll}
F(x^2) &= \sum_{k=0}^{\infty} C_k x^{2k} &= \frac{1 - \sqrt{1 - 4x^2}}{2x^2} \\
\int F(x^2) dx &= \sum_{k=0}^{\infty} \frac{1}{2k + 1} C_k x^{2k + 1} &= -\frac{1}{2x} + \sin^{-1}(2x) + \frac{\sqrt{1 - 4x^2}}{2x}
\end{array}

On the left, we have

\begin{align*}
\sum_{k=0}^{\infty} \frac{1}{2k + 1} C_k x^{2k + 1}
&= \sum_{k=0}^{\infty} \frac{1}{(k + 1)(2k + 1)} \binom{2k}{k} x^{2k + 1} \\
&= \sum_{k=0}^{\infty} \left(\frac{2}{2k + 1} - \frac{1}{k + 1}\right) \binom{2k}{k} x^{2k + 1} \\
&= \sum_{k=0}^{\infty} (2D_k - C_k) x^{2k + 1}
\end{align*}

Therefore,

\begin{align*}
\sum_{k=0}^{\infty} (2D_k - C_k) x^{2k + 1} &= -\frac{1 - \sqrt{1 - 4x^2}}{2x} + \sin^{-1}(2x) \\
\sum_{k=0}^{\infty} (2D_k - C_k) x^{2k} &= -\frac{1 - \sqrt{1 - 4x^2}}{2x^2} + \frac{\sin^{-1}(2x)}{x} \\
\sum_{k=0}^{\infty} (2D_k - C_k) x^k &= \underbrace{-\frac{1 - \sqrt{1 - 4x}}{2x}}_{-F(x)} + \frac{\sin^{-1}(2\sqrt{x})}{\sqrt{x}} \\
\sum_{k=0}^{\infty} D_k x^k &= \frac{\sin^{-1}(2\sqrt{x})}{2\sqrt{x}}
\end{align*}

Finally, substituting into the original integral gives

$$
I = \frac{\pi}{3} \cdot \frac{\sin^{-1}(\frac{1}{3})}{\frac{1}{3}} = \pi\sin^{-1}\left(\frac{1}{3}\right)
$$

## [ ] 20. ?

?

## [ ] 21. ?

?

## [✓] 22. Series

\begin{align*}
\int_0^{\infty} \log\left(\frac{e^x + 1}{e^x - 1}\right)
&= \int_0^{\infty} \log\left(\frac{1 + e^{-x}}{1 - e^{-x}}\right)  dx\\
&= -\int_0^{\infty}\left(\sum_{k=1}^{\infty} (-1)^{k} \frac{e^{-kx}}{k}\right) - \left(\sum_{k=1}^{\infty} -\frac{e^{-kx}}{k}\right) dx \\
&= 2\int_0^{\infty} \sum_{k=0}^{\infty} \frac{e^{-(2k + 1)x}}{2k + 1} dx \\
&= 2\sum_{k=0}^{\infty} \left[-\frac{e^{-(2k + 1)x}}{(2k + 1)^2}\right]_0^{\infty} \\
&= 2\left(1 + \frac{1}{3^2} + \frac{1}{5^2} + \cdots\right) \\
&= \frac{\pi^2}{4}
\end{align*}

## [✓] 23. Beta function

Recall that $B(a, b) = \int_0^1 t^{a - 1}(1 - t)^{b - 1} dt = \frac{\Gamma(a)\Gamma(b)}{\Gamma(a + b)}$ is the beta function. Then,

\begin{align*}
\int_0^1 \sqrt[4]{\frac{1}{x} - 1} dx
&= \int_0^1 x^{-\frac{1}{4}} (1-x)^{\frac{1}{4}} dx \\
&= B\left(\frac{3}{4}, \frac{5}{4}\right) \\
&= \frac{\Gamma\left(\frac{3}{4}\right)\Gamma\left(\frac{5}{4}\right)}{\Gamma(2)} \\
&= \Gamma\left(\frac{3}{4}\right)\left(\frac{1}{4}\Gamma\left(\frac{1}{4}\right)\right) \\
&= \frac{1}{4}\frac{\pi}{\sin{\frac{\pi}{4}}} & \Gamma(z)\Gamma(1 - z) = \frac{\pi}{\sin(\pi z)} \\
&= \frac{\sqrt{2}}{4}\pi
\end{align*}

## [✓] 24. Complex Trig

The mix of $\exp$ and $\cos$ suggests us to move to complex numbers. Indeed, we have

\begin{align*}
&\int_0^{2\pi} e^{\cos x} \cos(nx - \sin x) dx \\
&= \Re \int_0^{2\pi} e^{\cos x - i\sin x + inx} dx \\
&= \Re \int_0^{2\pi} e^{e^{-ix}} e^{inx} dx \\
&= \Re \sum_{k=0}^{\infty} \frac{1}{k!} \int_0^{2\pi} e^{-ikx + inx} \\
&= \Re \sum_{k=0}^{\infty} \frac{1}{k!} \int_0^{2\pi} e^{ix(n - k)} dx
\end{align*}

Now, note that we have that $\int_0^{2\pi} e^{ikx} dx = \begin{cases} 2\pi &\text{if}\, x = 0 \\ 0 &\text{otherwise} \end{cases}$. You can see this by symmetry or orthogonality. Therefore,

$$
\int_0^{2\pi} e^{\cos x} \cos(nx - \sin x) dx = \frac{1}{n!}
$$

## [✓] 25. Tricky DUTIS

Refer to [this](https://math.stackexchange.com/questions/3053019/integral-with-euler-mascheroni-constant). Answer is $-\frac{\gamma\pi}{2}$.

## [ ] 26. ?

?

## [✓] 27. Series

*Remark: Derived completely on my own.*

Let $u = \log x$. Then,

$$
\frac{\sin(\log x) - \log x}{\log^2 x} = \frac{\sin u - u}{u^2} = \sum_{k=1}^{\infty} \frac{(-1)^k u^{2k - 1}}{(2k + 1)!} = -\sum_{k=0}^{\infty} \frac{(-1)^k \log^{2k + 1} x}{(2k + 3)!}
$$

Now we compute the integral

$$
\int_0^1 \log^k x\, dx = \underbrace{\left[x\log^k x\right]_0^1}_0 - k\int_0^1 \log^{k - 1}x\, dx = (-1)^k k!
$$

Therefore,

\begin{align*}
\int_0^1 \frac{\sin(\log x) - \log x}{\log^2 x} dx
&= -\sum_{k=0}^{\infty} \frac{(-1)^k}{(2k + 3)!} \int_0^1 \log^{2k + 1} x\, dx \\
&= \sum_{k=0}^{\infty} \frac{(-1)^k}{(2k + 3)!} (2k + 1)! \\
&= \sum_{k=0}^{\infty} (-1)^k\left(\frac{1}{2k + 2} - \frac{1}{2k + 3}\right) \\
&= \sum_{k=0}^{\infty} \frac{(-1)^k}{2k + 2} - \sum_{k=0}^{\infty} \frac{(-1)^k}{2k + 3} \\
&= \frac{1}{2}\log 2 + \frac{\pi}{4} - 1
\end{align*}

## [ ] 28. ?

?

## [ ] 29. ?

?

## [ ] 30. ?

?