Compute $\int_{-\infty}^{\infty} \frac{1}{(x-5)^2}dx$ I want to compute $$I = \int_{-\infty}^{\infty} \frac{1}{(x-5)^2}dx.$$
We can use the following methods

*

*Compute directly $$I = -(x-5)^{-1}\bigg |_{-\infty}^{\infty}=-\bigg(\frac{1}{x-5}\bigg)_{-\infty}^{\infty}=-\bigg(0-0\bigg)=0$$

*Compute by residue $$I = 2\pi \text{ Res}(f(z);5)=0, \ \ \ \ f(z) = \frac{1}{(z-5)^2}$$ We know that it has a pole of order $2$. So its residue is $0$.

However, when checking by computer, I get "integral not converge". Not sure where I made mistakes. Thanks!

 A: You cannot use the formula $\int_a^b f(x) dx = F(b)-F(a)$ if $f$ is not regular enough on $(a,b)$. The integral, in fact, does not exist. To realize this, divide the integral for instance as
$$
\int_{-\infty}^4 f(x) dx + \int_4^6 f(x) dx + \int_6^{+\infty} f(x) dx
$$
The first and third integrals are convergent, but not the second.
A: $$I = \int_{-\infty}^{\infty} \frac{1}{(x-5)^2}dx=\int_{-\infty}^{5} \frac{1}{(x-5)^2}dx + \int_{5}^{\infty} \frac{1}{(x-5)^2}dx$$
Both integrals on the right are $+\infty$, so $I=\infty$
A: There is no need to resort to complex analysis, the problem here is that $$\int_{-\infty}^{5-\varepsilon}\frac{1}{(x-5)^2}=\left[\frac{-1}{x-5}\right]_{-\infty}^{5-\varepsilon}=\frac{1}{\varepsilon}\to +\infty$$ as $\varepsilon\to 0$. The same happens when you tend to $5$ from above.
In fact, the integral $$\int_0^{+\infty}\frac{1}{x^\alpha}$$ never converges for any $\alpha\in\mathbb{R}$, since it diverges obviously for $\alpha\leq0$ and diverges at $0$ or $+\infty$ for $\alpha>1$ and $0<\alpha<1$ respectively (and at both ends for $\alpha=1$).
