Evaluate using contour integration : $$\int_0^\infty\frac{x^\lambda}{(1+x)^2}dx$$ where $-1<\lambda\neq 0<1$.
For $\boxed{-1<\lambda<0}$ case, we choose a suitable keyhole contour taking $z=0$ as branch point and positive $x$-axis as branch cut. Now for radius of outer circle tending to infinity and that of inner circle around $z=0$ tending to $0$, we have by residue theorem : $$\int_0^\infty\frac{x^\lambda}{(1+x)^2}dx-e^{2i\pi\lambda}\int_0^\infty\frac{x^\lambda}{(1+x)^2}dx=2\pi i\lambda(-1)^{\lambda-1}=-2\pi i\lambda e^{i\pi\lambda} \\ \implies \int_0^\infty\frac{x^\lambda}{(1+x)^2}dx=\pi\lambda\frac{2i}{e^{i\pi\lambda}-e^{-i\pi\lambda}}=\frac{\lambda\pi}{\sin\lambda\pi}$$
That's one case finished. Now for $\boxed{0<\lambda<1}$, we can't keep the same contour as that will exclude the origin as before, whence $z=0$ is neither a pole nor there exists a residue at $z=0$. So what contour will be suitable for this case? Any help is appreciated.