I'm preparing for an exam and am trying to evaluate the following practice integral: $$P\int_{-\infty}^\infty \frac{e^{-ix}}{x^n} \, dx $$ where $n$ is a positive integer. $P$ here denotes that the integral is the Principal Value kind.
I can do the $n=1$ using the Indentation Lemma (or using the famous Dirichlet integral ) but for $n>1$ the Indentation Lemma (or doing it directly with the same contour) seems to fails.
The contour I am trying is contour along the real line completed by a semi-circle in the lower half plane, with an semi circle indent at $z=0$.
A solution would be very much appreciated.
In the special case of $n=1$ we can assign a value to the divergent integral by means of the Cauchy principal value interpretation $$ PV\int_{-\infty}^\infty \frac{e^{-ix}}{x} \, \mathrm dx=\lim_{\epsilon\to 0^+}\left(\int_{-\infty}^{-\epsilon}+\int_\epsilon^\infty\right)\frac{e^{-ix}}{x} \, \mathrm dx=-i\pi. $$ However, as you rightfully pointed out, when $n>1$ the Cauchy principal value interpretation fails to converge, which is due taking the limit $\epsilon\to 0$. In such cases we may turn to other means of regularization to assign values to the integral. The paper I linked to in the comments provides a means of assigning finite values to your integral for all $n=1,2,\dots$ via the Analytic Principal Value (APV) integral. Since $e^{-iz}$ is an analytic function we may compute the APV for your problem as $$ APV\int_{-\infty}^\infty \frac{e^{-ix}}{x^n} \, \mathrm dx=\int_{-\infty}^{-\epsilon} \frac{e^{-ix}}{x^n} \, \mathrm dx+\int_\epsilon^\infty \frac{e^{-ix}}{x^n} \, \mathrm dx+\frac{1}{2}\left(\int_{\gamma^+}+\int_{\gamma^-}\right)\frac{e^{-iz}}{z^n} \, \mathrm dz, $$ where $\gamma^+$ and $\gamma^-$ denote semicircular paths of radius $\epsilon$ into the upper and lower halfs of the complex plane, respectively. Note that since $e^{-iz}$ is analytic the value of the APV here is independent of the choice of $\epsilon>0$. Upon inspection, the APV is regularizing your integral by integrating along two separate paths that deform above and below the singular point and then computing their average.
I will leave it to you to work through the computations but here is a Mathematica implementation of the APV for your specific problem as well as a list of values for the first several $n$.
$$ \left( \begin{array}{cc} n &APV\\ 1 & -i \pi \\ 2 & -\pi \\ 3 & \frac{i \pi }{2} \\ 4 & \frac{\pi }{6} \\ 5 & -\frac{i \pi }{24} \\ 6 & -\frac{\pi }{120} \\ 7 & \frac{i \pi }{720} \\ 8 & \frac{\pi }{5040} \\ 9 & -\frac{i \pi }{40320} \\ 10 & -\frac{\pi }{362880} \\ \end{array} \right) $$