How to evaluate $ \int_{0}^{\infty} xe^{-ix(a-b)} d x $

I would like to solve the following integral: $$ \int_{0}^{\infty} xe^{-ix(a-b)} d x $$ a and b are real numbers.

Edit: the result should be $$\frac{1}{(a-b)^2}$$ I just found it on internet, but I still don't know how to demostrate it.


The integral isn't convergent but can be reinterpreted as a Fourier transform of a distribution.

Using the "non-unitary, angular frequency" variant of the Fourier transform, $$ \mathcal{F}\{ f(x) \} = \int_{-\infty}^{\infty} f(x) \, e^{-i\nu x} \, dx, $$ we can interpret the given integral as $\mathcal{F}\{ x\, u(x) \},$ where $u(x)$ is the Heaviside step function, then evaluated for $\nu=a-b.$

Using properties 107 and 313 we get $$ \mathcal{F}\{ x \, u(x) \} = i\frac{d}{d\nu} \mathcal{F}\{ u(x) \} = i\pi \frac{d}{d\nu} \left( \frac{1}{i\pi\nu} + \delta(\nu) \right) = i\pi \left( -\frac{1}{i\pi\nu^2} + \delta'(\nu) \right) = -\frac{1}{\nu^2} + i\pi\delta'(\nu). $$ Thus, $$ \int_{0}^{\infty} x e^{-i(a-b)x} \, dx = -\frac{1}{(a-b)^2} + i\pi\delta'(a-b). $$ With the distributional meaning of these terms it's not necessary to put a condition $a\neq b,$ but for a classical meaning we require $a\neq b$ and then the second term vanishes and we are left with $$ \int_{0}^{\infty} x e^{-i(a-b)x} \, dx = -\frac{1}{(a-b)^2}. $$


Start by writing the integral in the following way: \begin{eqnarray} I(k)=\int_{0}^{\infty}dx xe^{-ikx}, \hspace{10pt}k=a-b. \end{eqnarray} The integrand can be rewritten as: \begin{eqnarray} I(k)=i\int_{0}^{\infty}dx\frac{d}{dk}\left(e^{-ikx}\right) \end{eqnarray} Now consider performing the indefinite integral in $k$ and switch the order of integration on the RHS. This gives: \begin{eqnarray} \int I(k)dk = i\int_{0}^{\infty}dx\int dk\frac{d(e^{-ikx})}{dk}=i\int_{0}^{\infty}dxe^{-ikx} +C \end{eqnarray} where $C$ is an arbitrary constant. Now, the above integral is not convergent; you might use a convergence parameter $\epsilon>0$ to write: \begin{eqnarray} \lim_{\epsilon\to0^{+}}\int_{0}^{+\infty}dx e^{-ikx-\epsilon x}=\frac{e^{-ikx-\epsilon x}}{-ik-\epsilon}\bigg|_{0}^{\infty}=+\frac{1}{ik+\epsilon} \end{eqnarray} Multiplying by the prefactor $i$ we get: \begin{eqnarray} \lim_{\epsilon\to0^{+}}\frac{i}{ik+\epsilon}=\frac{1}{k} \end{eqnarray} So in total we have: \begin{eqnarray} \int dk I(k)=C+\frac{1}{k} \end{eqnarray} The function $I(k)$ that provides this indefinite integral is: \begin{eqnarray} I(k)=\frac{(-1)}{k^{2}}=\frac{(-1)}{(a-b)^{2}} \end{eqnarray} so the integral is evaluated.