Solution (source code)

= Solution

For $m=2$, evaluate the <improper integral> directly:
$$
I_{2,n}=\int_0^\infty(1+x)^{-n}dx
=\left[\frac{(1+x)^{1-n}}{1-n}\right]_0^\infty
=\boxed{\frac1{n-1}}.
$$
For $m\geq3$, use <integration by parts> with $u=x^{m-2}$ and $dv=(1+x)^{-(m+n-2)}dx$. Then $v=-(1+x)^{-(m+n-3)}/(m+n-3)$ and
$$
\begin{aligned}
I_{m,n}
&=\left[-\frac{x^{m-2}}{(m+n-3)(1+x)^{m+n-3}}\right]_0^\infty\\
&\quad+\frac{m-2}{m+n-3}\int_0^\infty\frac{x^{m-3}}{(1+x)^{m+n-3}}dx\\
&=\boxed{\frac{m-2}{m+n-3}I_{m-1,n}}.
\end{aligned}
$$
The boundary term vanishes: at zero $m-2>0$, while at infinity its power is $1-n<0$. The restriction $m\geq3$ belongs to this recurrence step; the separate $m=2$ base case must not be replaced by a formal zero times a divergent $I_{1,n}$.