Please, compare and contrast different spaces, it depends on the space! I cannot formulate this mathematically but I think that $\mathbb R$ extended with infinities behave totally differently.
$\int_{0}^{\infty}\frac{1}{kx^{2}+1} dx=\int_{0}^{\infty} dx -\int_{0}^{\infty}\frac{kx^{2}}{kx^{2}+1}$ where the term $\int_{0}^{\infty} dx$ diverges.
But
Let's consider $k=1$ then $\int_{0}^{\infty}\frac{1}{x^{2}+1} dx= Arctan(x)_{0}^{\infty} =\frac{\pi}{2}$ so I must have some mistake in
$\int_{0}^{\infty}\frac{1}{kx^{2}+1} dx=\int_{0}^{\infty}\frac{(kx^{2}+1)-kx^{2}}{kx^{2}+1} dx=\int_{0}^{\infty} dx -\int_{0}^{\infty}\frac{kx^{2}}{kx^{2}+1}$
but I cannot see it, where am I doing a mistake?
[Update]
Let' s take simpler example:
$\int_{0}^{\infty} \frac{1+x+x^{2}+x^{3}}{x^{k}} dx= \int_{0}^{\infty} x^{-k} dx+\int_{0}^{\infty} x^{-k+1} dx+ \int_{0}^{\infty} x^{-k+2} dx+ \int_{0}^{\infty} x^{-k+3}dx$
So this is also wrong? I cannot break it up like this? What does it mean to be $indefinite$? If I have extended real space $\mathbb R\cup\{\infty\}\cup\{-\infty\}$, what about now? Now look $\infty$ is just a normal number now, it is not indefinite so does it converge?