Finding $\int_0^{\frac{\pi}{2}} \frac{x}{\sin x} dx $

1st Solution. Applying the Weierstrass substitution $t=\tan(x/2)$, it follows that

\begin{align*} \int_{0}^{\frac{\pi}{2}} \frac{x}{\sin x} \, \mathrm{d}x &= \int_{0}^{1} \frac{2\arctan(t)}{2t/(1+t^2)} \, \frac{2\mathrm{d}t}{1+t^2} = 2 \int_{0}^{1} \frac{\arctan t}{t} \, \mathrm{d}t. \end{align*}

Now note that we have

$$ \frac{\arctan(t)}{t} = \sum_{n=0}^{\infty} \frac{(-1)^n}{2n+1} t^{2n} $$

for $-1 \leq t \leq 1$. So by the Abel's theorem, its integral from $0$ to $1$ can be computed by performing term-wise integration. (In other words, we can interchange the order of infinite summation and integral.) This yields

\begin{align*} \int_{0}^{\frac{\pi}{2}} \frac{x}{\sin x} \, \mathrm{d}x &= 2 \sum_{n=0}^{\infty} \frac{(-1)^n}{2n+1} \int_{0}^{1} t^{2n} \, \mathrm{d}t = 2 \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)^2} = 2C. \end{align*}


2nd Solution. Using $\sin x = (e^{ix} - e^{-ix})/2i$, the integral is recast as

$$ \int_{0}^{\frac{\pi}{2}} \frac{x}{\sin x} \, \mathrm{d}x = \frac{2}{i} \int_{0}^{\frac{\pi}{2}} \frac{xe^{ix}}{1 - e^{2ix}} \, \mathrm{d}x. $$

To expand the integrand, se adopt the following regularization:

$$ \int_{0}^{\frac{\pi}{2}} \frac{xe^{ix}}{1 - e^{2ix}} \, \mathrm{d}x = \lim_{r \to 1^-} \int_{0}^{\frac{\pi}{2}} \frac{xe^{ix}}{1 - re^{2ix}} \, \mathrm{d}x $$

(This limit is easily verified by the dominated convergence theorem.) Now taking advantage of the fact taht $|re^{2ix}| < 1$, we can invoke the geometric series formula to expand

\begin{align*} \int_{0}^{\frac{\pi}{2}} \frac{xe^{ix}}{1 - re^{2ix}} \, \mathrm{d}x &= \int_{0}^{\frac{\pi}{2}} xe^{ix} \sum_{n=0}^{\infty} \bigl( re^{2ix} \bigr)^n \, \mathrm{d}x \\ &= \sum_{n=0}^{\infty} r^n \int_{0}^{\frac{\pi}{2}} xe^{(2n+1)ix} \, \mathrm{d}x \\ &= \sum_{n=0}^{\infty} r^n \left( \frac{\pi}{2} \cdot \frac{(-1)^n}{2n+1} - \frac{1}{(2n+1)^2} + \frac{(-1)^n}{(2n+1)^2}i \right) \end{align*}

Letting $ r \to 1^-$, by the Abel's theorem, the limit can be computed term-wise to yield

\begin{align*} \int_{0}^{\frac{\pi}{2}} \frac{x}{\sin x} \, \mathrm{d}x &= \frac{2}{i} \sum_{n=0}^{\infty} \left( \frac{\pi}{2} \cdot \frac{(-1)^n}{2n+1} - \frac{1}{(2n+1)^2} + \frac{(-1)^n}{(2n+1)^2}i \right) \\ &= \frac{2}{i} \biggl( \frac{\pi^2}{8} - \sum_{n=0}^{\infty} \frac{1}{(2n+1)^2} \biggr) + 2C \end{align*}

However, since the integral is real-valued, the imaginary part must vanish. Therefore we obtain the desired identity as well as a lucky by-product:

$$ \int_{0}^{\frac{\pi}{2}} \frac{x}{\sin x} \, \mathrm{d}x = 2C \qquad\text{and}\qquad \sum_{n=0}^{\infty} \frac{1}{(2n+1)^2} = \frac{\pi^2}{8}. $$


$$ \begin{aligned} I&=\int_{0}^{\pi / 2} \frac{x}{\sin (x)} d x\\&=\frac{1}{2} \int_{0}^{\pi / 2} \frac{x}{\cos \left(\frac{x}{2}\right) \sin \left(\frac{x}{2}\right)} d x \\ &=\frac{1}{2} \int_{0}^{\pi / 2} \frac{x}{\cos \left(\frac{x}{2}\right) \sin \left(\frac{x}{2}\right)} \frac{1}{\frac{\cos \left(\frac{x}{2}\right)}{\cos \left(\frac{x}{2}\right)}} d x \\ &=\frac{1}{2} \int_{0}^{\pi / 2} \frac{x}{\cos ^{2}\left(\frac{x}{2}\right) \tan \left(\frac{x}{2}\right)} d x\\ &=\frac{1}{2} \int_{0}^{\pi / 2} \frac{x \sec ^{2}\left(\frac{x}{2}\right)}{\tan \left(\frac{x}{2}\right)} d x\\ &=2 \int_{0}^{1} \frac{\arctan (x)}{x} d x \qquad\left(\tan \left(\frac{x}{2}\right) \to x \right)\\ &=2 \int_{0}^{1} \sum_{k=0}^{\infty} \frac{(-1)^{k}}{(2 k+1)} x^{2 k} d x \\ &=2 \sum_{k=0}^{\infty} \frac{(-1)^{k}}{(2 k+1)^{2}}\\ &=2 G \qquad \blacksquare \end{aligned} $$


As you posted:

$$ \int_0^{\frac{\pi}{2}} \frac{x}{\sin x} dx \\ \sum_0^{\infty} \frac{4^n}{\binom{2n}{n}(2n+1)^2}$$

You can rewrite it as the following using the definition of the central binomial coefficient:

$$\sum_0^{\infty} \frac{4^n}{\binom{2n}{n}(2n+1)^2} = \sum_0^{\infty} \frac{4^n}{\frac{(2n)!}{n!^2}(2n+1)^2} = \sum_0^{\infty} \frac{4^n}{\frac{4^nΓ\left(n+\frac12\right)}{\sqrt{\pi}Γ(n+1)}(2n+1)^2}=\frac{\sqrt \pi}2\sum_0^\infty \frac{n!}{\left(n+\frac12\right)!(2n+1)} $$

Now let’s apply the main definition of the $\,_3\text F_2$ Hypergeometric function using Pochhammer Symbol:

$$\,_3\text F_2(a_1,a_2,a_3;b_1,b_2;z)=\sum_{n=0}^\infty \frac{(a_1)_n(a_2)_n(a_3)_n x^n}{(b_1)_n(b_2)_nn!}$$

The constant is then as seen in formula $(4)$ of this arxiv article:

$$\,_3\text F_2\left(\frac12,1,1;\frac32,\frac32;\frac{4x}{(x+1)^2}\right)=(x+1)\sum_{n=0}^\infty \frac{(-x)^n}{(2n+1)^2}$$ Therefore

$$ \int_0^{\frac{\pi}{2}} x\csc(x)= \,_3\text F_2\left(\frac12,1,1;\frac32,\frac32;1\right)=2\text C$$

Please correct me and give me feedback!