It's been quite a time since I had the complex analysis course. The thing is now I don't know the answer to the following simple question:
Is it possible to find
$$ \int_0^1 x^n \, dx$$
using the methods of contour integration? I've refreshed my knowledge with wikipedia, but I've no idea how to make integrals with no obvious singularities. Though there is a singularity at $\infty$, but how to connect it with $[0,1]$?
Let's consider the contour from $0$ to $1$ ($z=x$) followed by a rotation of angle $\angle \frac{2\pi}n$ ($z=e^{i\phi}$) and then back to $0$ ($z= e^{i\frac {2\pi}n} x$) :
$$\int_0^1 x^n\,dx+\int_0^{\frac {2\pi}n} e^{ni\phi}ie^{i\phi}\,d\phi +\int_1^0 \left(e^{i\frac {2\pi}n}x\right)^n e^{i\frac {2\pi}n}\,dx=0$$
(the integral is $0$ of course for $n\ne -1$)
since $\displaystyle \int_0^{\frac {2\pi}n} e^{ni\phi}ie^{i\phi}\,d\phi=\left[\frac{e^{(n+1)i\phi}}{n+1}\right]^{\frac {2\pi}n}_{\phi=0}$ we get : $$\left(1-e^{i\frac {2\pi}n}\right)\int_0^1 x^n\,dx=\frac {1-e^{i\frac {2\pi}n}}{n+1}$$
so that for $n\ne 1$ and $n\ne -1$ at least : $\ \displaystyle \int_0^1 x^n\,dx=\frac 1{n+1}$
For $n=1$ we may choose another maximal angle (for example $\pi$ or $\frac {\pi}2$).
Looking back at this there is some feeling of cheating since we replaced a power integral over $x^n$ by the nearly equivalent integral $\int e^{(n+1)i\phi}\,d\phi$ (at least the increment of $n$ was done!).