<s>[INST] Compute $ \int_{-\infty}^{\infty} \frac{x^2}{(1+x^2)^2} dx$ Compute $$ \int_{-\infty}^{\infty} \frac{x^2}{(1+x^2)^2} dx$$
Of course we have $$ \int_{-\infty}^{\infty} \frac{x^2}{(1+x^2)^2} dx = 2 \int_{0}^{\infty} \frac{x^2}{(1+x^2)^2} dx = 2 \int_{0}^{\infty} \left( \frac{x}{1+x^2}  \right) ^2 dx =  \lim_{ A \to \infty }  \int_{0}^{A} \left( \frac{x}{1+x^2}  \right) ^2 dx $$
I think that firstly I should compute $ \int \left( \frac{x}{1+x^2}  \right) ^2 dx $ but I don't have idea.
 [/INST] I know I'm a bit late for the party, but here is another solution:
$$\begin{align}
2\int_{0}^\infty \frac{x^2}{(1+x^2)^2}\mathrm dx &=
\frac22\int_{-\infty}^\infty \frac{y^{\frac{2-1}{2}}}{(1+y)^2}\mathrm dx \\
&= B\bigl(\tfrac12 + 1, 2-\tfrac12 -1\bigr) = B\bigl(\tfrac32,\tfrac12\bigr) \\
&= \frac{\Gamma\bigl(\tfrac32\bigr)\Gamma\bigl(\tfrac12\bigr)}{\Gamma(2)} \\
&= \frac{\sqrt\pi \cdot \frac12 \sqrt\pi}{1} = \frac\pi 2
\end{align}
$$
The first step is the substitution $x^2 \mapsto y$, the second and third step are the use of well-known (and very easy to proof) representations of the Beta function.
</s>