This is just the definition of improper Riemann integration:
$$\int_{0}^\infty \frac{1}{1+x^2}\ dx:=\lim_{a \to \infty}\int_{0}^a \frac{1}{1+x^2}\ dx$$
then deform the right-side definite integral to the limit of Riemann sum and you will find the answer.
More specifically, let $f(\cdot)$ defined on $(0,\infty)$ can be integrated in the sense of improper Riemann integration, then
$$\int_0^\infty f(x)\ dx=\lim_{N \to \infty}\int_0^N f(x)\ dx=\lim_{n,N\to \infty}\sum_{t=1}^{Nn}{1 \over n}f\bigg({t \over n}\bigg)$$
where the last term can be evaluated by $\lim_{n \to \infty}\sum_{t=1}^{\infty}{1 \over n}f\bigg({t \over n}\bigg)$ from the following simple argument:
Let $a:=\lim_{n,N\to \infty}\sum_{t=1}^{Nn}{1 \over n}f\bigg({t \over n}\bigg), b:=\lim_{n \to \infty}\sum_{t=1}^{\infty}{1 \over n}f\bigg({t \over n}\bigg)$, then
\begin{equation*}
\begin{split}
|a-b| &\leq \bigg|a-\sum_{t=1}^{Nn}{1 \over n}f\bigg({t \over n}\bigg)\bigg|+\bigg|\sum_{t=1}^{Nn}{1 \over n}f\bigg({t \over n}\bigg)-b\bigg|
\end{split}
\end{equation*}
by which $|a-b|$ can be as small as we want whence $a=b$.