The value of the integral $\displaystyle\int^\infty_0\frac{x^n-1}{x+1}\ \mathrm dx, $ for $0<n<1$, is $\frac{π}{\sin nπ}$.
Here, to solve this, I took $x=\tan^2t \ \ \ \ (1)$
$\implies \mathrm dx=2\tan t\cdot\sec^2t\ \mathrm dt$
Lower & Upper limit : putting $x=0$ & $\infty$ in $(1)$ gives $ \ \ t =0$ & $π/2$ respectively.
Now substituiting all those values we get $\displaystyle\int^\frac{π}{2}_0\frac{(\tan^{2n-2}t)2 \tan t\sec^2t}{1+\tan^2t}\ \mathrm dt$
Or $\displaystyle\int ^\frac{π}{2}_0\sin^{2n-1}t\cos^{1-2n}t\ \mathrm dt$
After this, I don't get how to proceed towards the answer.
Due to the substitution $\frac{1}{1+x}\to u$, Euler's Beta function and the reflection formula for the $\Gamma$ function we have
$$ \int_{0}^{+\infty}\frac{\color{red}{x^n}}{x+1}\,dx = \color{red}{-}\frac{\pi}{\sin(n\pi)}\quad\text{for any }\color{red}{n\in(-1,0)}$$
while the integral $\int_{0}^{+\infty}\frac{x^n}{x+1}\,dx$ is divergent for any $n\geq 0$.