complex integration using residue theorem I have the following integration
$$g_n=\frac{(-1)^n}{2\pi} \int_{-\infty} ^ {\infty} (\frac {e^{-itx}}{(it-1)^n})dt $$.
I used the residue theorem to find the integration so the result of the integration was $$ (\frac{(-1)^{n-1} x^{n-1} e^{-x}}{(n-1)!}) $$
so the final result of $g_n$ was 
$$ (\frac{(-1) X^{n-1}e^{-x}}{(n-1)!}) $$ that was my result but the question was to prove that $$ g_n = (\frac{ X^{n-1}e^{-x}}{(n-1)!}) $$
MY Answer
$$ \int_{-\infty} ^ {\infty} (\frac {e^{-itx}}{(it-1)^n})dt= 2\pi i RES(\frac {e^{-itx}}{(it-1)^n})$$
put $it = z$ then $dz = idt$
$$RES(\frac {e^{-zx}}{(z-1)^n})= (\frac {1}{(n-1)!}) (-1)^{n-1}x^{n-1}e^{-x} $$
$$g_n=\frac{(-1)^n}{2\pi} \int_{-\infty} ^ {\infty} (\frac {e^{-zx}}{(z-1)^n})(\frac {dz}{i}) $$
$$ g_n =(\frac{(-1)^n}{2\pi i}) (\frac {2 \pi i}{(n-1)!}) (-1)^{n-1}x^{n-1}e^{-x} $$
as $(-1)^{2n-1} = -1^{2n-2} \times -1$ and $-1^{2n-2}$ is even
then $$g_n = (\frac{(-1) X^{n-1}e^{-x}}{(n-1)!}) $$ 
I would appreciate if anyone can help me get the required answer.
 A: It is always a good idea to start with a complete contour when using residue calculus to find the integer. For $x>0$, we have to choose a lower semi-circle of radius $R$, while for $x<0$ an upper semi-circle. The reason is that $\exp(-ixz)$ decays to zero exponentially as $R$ goes to infinity (the integral below on $\mathcal{C}_2$ vanishes as $R$ goes to infinity).
For $x>0$, we have 
$$ \int_{\mathcal{C}_2} \frac{e^{-ixz}}{(iz-1)^n} dz - \int_{\mathcal{C}_1} \frac{e^{-ixz}}{(iz-1)^n} dz = 2\pi i\mbox{Res}\left(\frac{e^{-ixz}}{(iz-1)^n},z=-i\right)=\frac{(-1)^{n-1}2\pi}{(n-1)!} x^{n-1}e^{-x}.$$
Taking the limit as $R$ goes to infinity, the integral on $\mathcal{C}_2$ vanishes and we get
$$
g_n =\lim_{R\to\infty}\frac{(-1)^n}{2\pi} \int_{\mathcal{C}_1} \frac{e^{-ixz}}{(iz-1)^n} dz = -\frac{(-1)^n}{2\pi}\frac{(-1)^{n-1}2\pi}{(n-1)!} x^{n-1}e^{-x}=\frac{1}{(n-1)!}x^{n-1}e^{-x}.
$$
For $x<0$, the singular point is outside the contour and
$$
\int_{-\infty}^\infty \frac{e^{-itx}}{(it-1)^n}dt=\lim_{R\to\infty} 
\int_{\mathcal{C}_1} \frac{e^{-ixz}}{(iz-1)^n} dz =
\int_{\mathcal{C}_2} \frac{e^{-ixz}}{(iz-1)^n} dz = 0.
$$
Therefore $g_n\equiv 0$.

