How to compute this integral $\int^\infty_0 \frac{x^{n-1}}{(1+x^2)^n}dx$? For the integral $\int^\infty_0 \frac{x^{n-1}}{(1+x^2)^n}dx$, $n\in \mathbb{N}$, I would like to solve it in the following way:
$$
\int^\infty_0 \frac{x^{n-1}}{(1+x^2)^n}dx \overset{x=\tan t}{===} \int^{\frac{\pi }{2}}_{0}\left (\tan t  \right )^{^{n-1}}dt.
$$
When $n=1$ the answer is $\frac{\pi}{2}$. However, the following equation is valid:
$$
\int^{\frac{\pi }{2}}_{0}\tan tdt=-\ln |\cos t|\mid^{\frac{\pi}{2}}_{t=0} \ .
$$
Hence, we know taht this integral can not be convergent when $n=2$. But I have proved that this integral is convergent for $n\in \mathbb{N}$. 
Question:
$1.$ Where I went wrong? 
$2.$ if it is truly convergent how to compute this integral for $n\in \mathbb{N}$? 
 A: If we put $x=\tan t$, then $dx=\sec^2 t\,dt$. The bottom becomes $\sec^{2n} t$. So we end up integrating $\frac{\tan^{n-1}t}{\sec^{2n-2} t}$, that is, $\sin^{n-1} t \cos^{n-1}t$. One way to continue is to rewrite in terms of $\sin 2t$, and use a Reduction Formula. One can also obtain a reduction formula directly for the original function, without travelling through the trigonometric substitution process.  
A: André Nicolas gave the correct expression of the integrand and suggested a method to be used.   
Making or not the change of variable, the calculation of the antiderivative leads to an hypergeometric geometric function $$ \frac{x^n \, _2F_1\left(\frac{n}{2},n;\frac{n}{2}+1;-x^2\right)}{n}$$ $$-\frac{\cos ^n(t) \, _2F_1\left(\frac{2-n}{2},\frac{n}{2};\frac{n+2}{2};\cos
   ^2(t)\right)}{n}$$ The value of the integral is then $$\frac{\sqrt{\pi } 2^{-n} \Gamma \left(\frac{n}{2}\right)}{\Gamma
   \left(\frac{n}{2}+\frac{1}{2}\right)}$$ which is a continuous function of $n$ provide that $\Re(n)>0$.
