I think the solution to the improper integral $\int_{0}^{+\infty}\frac{1}{\left(1+x^{2}\right)^{m}}dx$ is wrong Given
$$\int_{0}^{+\infty}\frac{1}{\left(1+x^{2}\right)^{m}}dx$$ such that $m>0$.
Study the convergence of the previous integral.
Now, I've tried solving for $m$ using the comparison tests but have been unsuccessful. Luckily, I've found the solution online but for $m\in N$ ("Show that the previous integral converges for every $m\in N$ "). For what I saw, they aren't that different from one another. Anyways, here it is:
(My notes are between parenthesis)
Change of variable: $x=\tan(t)$ 
So: $dx=\sec^2(t)dt$
(Note: I suppose he/she took $t$ as $\arctan(x)$)
The bounds of integration now are:
$t=0$ (Corresponding to $x=0$)
$t=\pi/2$ (When $x=\infty$)
(Now, this is the part that doesn't convince me so much. First, there are infinite $t$ such that $tg(t)=0$. Second, there is no $t=\pi/2$ when $x$ goes to infinity - I mean, isn't that the $arctg(x)$? On the other hand, the process seems to be pretty much in order to me)
$\int_{0}^{\pi/2}\frac{\sec^2(t)}{(1+tg^2(t))^{m}}dt=\int_{0}^{\pi/2}\sec^{\left(2-2m\right)}\left(t\right)dt=\int_{0}^{\pi/2}\cos^{\left(2m-2\right)}\left(t\right)dt$
Which converges for every natural $m$. (I think, similarly, the way of solving and solution would be the same as saying for every $m>0$. Please correct me if I'm wrong at this.)

So, what do you think? If this is wrong as I presumed, can you help me with the solution? Thanks in advance!
P.S. Here is the link to the solution (http://www.ehu.eus/~mtpalezp/mundo/ana1/EJERCICIOSINTEGRALIMPROPIA.pdf). Page 4, at the bottom. Exercise 13. Note: It's in Spanish.
 A: Here it is an alternative approach.
To begin with, I would start by noticing that
\begin{align*}
\int_{0}^{\infty}\frac{\mathrm{d}x}{(1+x^{2})^{m}} = \int_{0}^{1}\frac{\mathrm{d}x}{(1+x^{2})^{m}} + \int_{1}^{\infty}\frac{\mathrm{d}x}{(1+x^{2})^{m}}
\end{align*}
According to the substitution $u = 1/x$, one has
\begin{align*}
\int_{1}^{\infty}\frac{\mathrm{d}x}{(1+x^{2})^{m}} = -\int_{1}^{0}\frac{u^{2m-2}}{(1+u^{2})^{m}}\mathrm{d}u = \int_{0}^{1}\frac{u^{2m-2}}{(1+u^{2})^{m}}\mathrm{d}u
\end{align*}
Consequently, we conclude that
\begin{align*}
\int_{0}^{\infty}\frac{\mathrm{d}x}{(1+x^{2})^{m}} = \int_{0}^{1}\frac{1+x^{2m-2}}{(1+x^{2})^{m}}\mathrm{d}x
\end{align*}
which converges. Indeed, for $m\geq 1$, we have that
\begin{align*}
0\leq x \leq 1 & \Longrightarrow
\begin{cases}
1\leq 1 + x^{2m-2}\leq 2\\\\
1\leq (1+x^{2})^{m}\leq 2^{m}
\end{cases}\\\\
& \Longrightarrow
\begin{cases}
1 \leq 1 + x^{2m-2} \leq 2\\\\
\displaystyle \frac{1}{2^{m}}\leq \frac{1}{(1+x^{2})^{m}}\leq 1
\end{cases}\\\\
& \Longrightarrow \frac{1}{2^{m}} \leq \frac{1+x^{2m-2}}{(1+x^{2})^{m}} \leq 2
\end{align*}
A: Convergence
Note that we can break up the integral as
$$
\begin{align}
\int_0^\infty\frac1{\left(1+t^2\right)^m}\mathrm{d}t
&=\overbrace{\int_0^1\frac1{\left(1+t^2\right)^m}\mathrm{d}t}^{\le\int_0^11\,\mathrm{d}t=1}+\color{#090}{\overbrace{\int_1^{\infty\vphantom{1}}\frac1{\left(1+t^2\right)^m}\mathrm{d}t}^{\le\int_1^\infty t^{-2m}\,\mathrm{d}t=\frac1{2m-1}}}
\end{align}
$$
where the green integral converges for $m\gt\frac12$.

Evaluation
After the substitution $t\mapsto t^{1/2}$, we get a Beta Function integral
$$
\begin{align}
\int_0^\infty\frac1{\left(1+t^2\right)^m}\mathrm{d}t
&=\frac12\int_0^\infty\frac{t^{-1/2}}{\left(1+t\right)^m}\mathrm{d}t\\
&=\frac12\frac{\Gamma\!\left(\frac12\right)\Gamma\!\left(m-\frac12\right)}{\Gamma(m)}
\end{align}
$$
A: If I understood correctly, it's the substitution $x=\tan(t)$ that causes confusion. Making this substitution, we have
$$\int_0^{\infty}\frac{1}{(1+x^2)^m}\,dx=\int_a^b\frac{\sec^2(t)}{\left(1+\tan^2(t)\right)^m}\,dt $$
To determine the new limits of integration, we need to choose $a$ and $b$ (where $b$ may be a number or $\infty$, in general) such that $\tan(t)$ is continuously differentiable in $[a,b)$, $\tan(a)=0$, and $\lim_{t\to b^-}\tan(t)=\infty$. One possible choice is $a=0,b=\pi/2$. But the function $t\mapsto\tan(t)$ is not injective so there's many possible choices. Another one is $a=\pi,b=3\pi/2$. You can add multiples of $\pi$ to $a$ and $b$ to obtain the next choices. The fact that different $a$ and $b$ work is not a problem, and you can verify that all valid choices lead to the same value of the integral on the RHS. Finally, there are quicker and easier ways to prove the convergence of the integral. See the comments for some ideas.
