How to show $\int_0^\infty\frac1{(1+x^2)(1+x^p)}$ doesn't depend on $p$?

Substitute $t=\frac{1}{x}$: $$I=\int_{\infty}^0 \frac{-\frac{1}{t^2}}{\left(1+\frac{1}{t^2}\right)\left(1+\frac{1}{t^p}\right)} \; \mathrm{d}t=\int_0^{\infty} \frac{t^p}{\left(t^2+1\right)\left(t^p+1\right)} \; \mathrm{d}t$$ Now add the original integral and remember that $x$ and $t$ are dummy variables, so we can just call both of them $x$: \begin{align*} 2I&=\int_0^{\infty} \frac{x^p+1}{\left(x^2+1\right)\left(x^p+1\right)} \; \mathrm{d}x\\ &=\int_0^{\infty} \frac{\mathrm{d}x}{x^2+1}\\ I&=\frac{\pi}{4}\\ \end{align*}


You could also define $S(p):=\int_0^\infty\frac{dx}{(x^2+1)(x^p+1)}$. Then $$S'(p)=\int_0^\infty\frac{\partial}{\partial p}\Bigg[\frac{1}{(x^2+1)(x^p+1)}\Bigg]dx=\int_0^\infty\frac{x^p\ln(1/x)dx}{(x^2+1)(x^p+1)^2}$$ The subtitution $u=1/x$ yields $$S'(p)=\int_0^\infty\frac{u^p\ln(u)du}{(u^2+1)(u^p+1)^2}=-S'(p)$$ Hence $S'(p)=0$ implying $S(p)\equiv \text{constant}$. Since $S(0)=\pi/4$ we have $S(p)=\pi/4$ for all $p$.