I have integration whose result change depending on the way of calculation.
I want to compute the integration below $$I=\int_{-\infty}^\infty \exp(iqy')dy' \int_{-\infty}^\infty |k|\exp(ik(y-y'))dk$$
If integration is conducted in the order $y'$, $k$
$$\begin{align} I&=\int_{-\infty}^\infty \exp(iqy')dy' \int_{-\infty}^\infty |k|\exp(ik(y-y'))dk\\ &=2\pi \int_{-\infty}^\infty |k|\exp(iky)\delta(q-k) dk\\ &=2\pi |q|\exp(iqy) dk \end{align}$$
However, if integration is conducted in the order $k$, $y'$ with the formula, $\int_{-\infty}^\infty dk |k|\exp(ik(y-y'))=-\frac{1}{(y-y')^2}$, it returns different result. $$\begin{align} I&=\int_{-\infty}^\infty \exp(iqy')dy' \int_{-\infty}^\infty |k|\exp(ik(y-y'))dk\\ &= \int_{-\infty}^\infty \frac{\exp(iqy')}{(y-y')^2} dy'\\ \end{align}$$ The integration of latter case does not converge. This is the apparent contradiction.
I have asked the simplified form of the Fourier transform of $|x|$ in stack exchange before and some people point out my treatment of Fourier transform is incorrect in the view of convergence. However I cannot understand the problem. Maybe there is relationship why Integration fail here.
Any advice is welcome. Thank you.