Doing the integral $\int_0^\infty \frac{x^{s-1}}{1+x} dx =\frac{\pi}{\sin \pi s }$ Here $0<s < 1$. 
It is a standard example in complex analysis. But I am curious whether it can be done without using complex analysis. 
At least the $s=1/2$ case is easy. With the change of variable $x = y^2$, 
$$ \int_0^\infty \frac{x^{-1/2}}{1+x}dx = \int_0^\infty \frac{2 dy }{1+y^2} = \pi .  $$
 A: Here's an elementary approach (that is, only using Fourier series).
First, $$\begin{split}
\int_0^\infty \frac{x^{s-1}}{1+x} dx &=\int_0^1\frac{x^{s-1}}{1+x} dx+\int_1^{+\infty}\frac{x^{s-1}}{1+x} dx\\
&= \int_0^1\frac{x^{s-1}}{1+x} dx+\int_0^{1}\frac{u^{-s-1}}{1+\frac 1 u} du \,\,\,\left(\text{ with } u=\frac 1 x\right)\\
&= \int_0^1\frac{x^{s-1}}{1+x} dx+\int_0^{1}\frac{u^{-s}}{1+u} du\\
\end{split}$$
Now, if $t\notin \mathbb Z$,
$$\begin{split}
\int_0^1\frac{x^{t}}{1+x} dx &=\int_0^1x^t\sum_{k\in\mathbb N}(-1)^kx^kdx\\
&=\sum_{k\in\mathbb N}(-1)^k\int_0^1x^{k+t}dx\\
&=\sum_{k\in\mathbb N}\frac{(-1)^k}{k+t+1}\\
\end{split}$$
Therefore
$$\begin{align}
\int_0^\infty \frac{x^{s-1}}{1+x} dx &=\sum_{k\in\mathbb N}\frac{(-1)^k}{k+s} + \sum_{k\in\mathbb N}\frac{(-1)^k}{k-s+1}\\
&= \sum_{k\geq 0}\frac{(-1)^k}{k+s} + \sum_{k\geq 0}\frac{(-1)^{k+1}}{s-k-1}\\
&= \sum_{k\geq 0}\frac{(-1)^k}{k+s} + \sum_{k\leq-1}\frac{(-1)^{k}}{s+k}\\
&= \sum_{k\in\mathbb Z}\frac{(-1)^k}{k+s}\tag1
\end{align}$$
We'll get back to that identity. Now, let's take a detour via Fourier series. For $s\notin\mathbb Z$, define $f_s$ be the $2\pi$-periodic function defined by $f_s(t)=\cos(st)$ for $|t|< \pi$.
You can verify that its Fourier series expansion is
$$\cos{st} = \frac{\sin{\pi s}}{\pi s} \left [1+2 s^2 \sum_{k=1}^{\infty} \frac{(-1)^{k+1} \cos{k t}}{k^2-s^2} \right ]$$
Evaluating at $t=0$ yields
$$\begin{split}1 &= \frac{\sin{\pi s}}{\pi s} \left [1+2 s^2 \sum_{k=1}^{\infty} \frac{(-1)^{k+1} }{k^2-s^2} \right ]\\
&=\frac{\sin{\pi s}}{\pi s} \left [1+s \sum_{k=1}^{\infty} (-1)^{k+1}\left(\frac{1 }{k-s} -\frac 1 {k+s}\right)\right ]\\
&= \frac{\sin{\pi s}}{\pi s} \left [s \sum_{k\in\mathbb Z} \frac{(-1)^{k}}{k+s} \right]\\
\end{split}$$
Therefore, if $s\notin \mathbb Z$,
$$\sum_{k\in\mathbb Z} \frac{(-1)^{k}}{k+s} = \frac{\pi}{\sin(\pi s)}\tag2$$
Matching $(1)$ and $(2)$, we can now conclude that
$$\int_0^\infty \frac{x^{s-1}}{1+x} dx= \frac{\pi}{\sin(\pi s)}$$
