Closed form of integral using contour integration Here is the integral I am interested in evaluating using contour integration:

Prove that: $$\int_0^\infty \frac{{\rm d}x}{(1+x^2)(1+x^r)}=\frac{\pi}{4}$$

That is that the above integral is independant of $r$ which is assumed to be a positive real number. 
I have a couple of approaches using real analysis. For instance,
$$\begin{align*}
\int_{0}^{\infty}\frac{{\rm d}x}{\left ( 1+x^2 \right )\left ( 1+x^r \right )} &=\int_{0}^{1}\frac{{\rm d}x}{\left ( 1+x^2 \right )\left ( 1+x^r \right )}+ \int_{1}^{\infty}\frac{{\rm d}x}{\left ( 1+x^2 \right )\left ( 1+x^r \right )} \\ 
 &\overset{u=1/x}{=\! =\! =\!}\int_{0}^{1}\frac{{\rm d}x}{\left ( 1+x^2 \right )\left ( 1+x^r \right )} +\int_{0}^{1}\frac{x^r}{\left ( x^2+1 \right )\left ( 1+x^r \right )}\, {\rm d}x \\ 
 &= \require{cancel} \int_{0}^{1}\frac{\cancel{x^r+1}}{\left ( x^2+1 \right )\cancel{\left ( x^r+1 \right )}}\, {\rm d}x \\
 &= \int_{0}^{1}\frac{{\rm d}x}{x^2+1}\\
 &= \arctan 1 = \frac{\pi}{4}
\end{align*}$$
or by applying the sub $x=\tan u$ we have that:
$$\begin{align*}
\int_{0}^{\infty}\frac{{\rm d}x}{\left ( 1+x^2 \right )\left ( 1+x^r \right )} &\overset{x=\tan u}{=\! =\! =\! =\!}\int_{0}^{\pi/2}\frac{\sec^2 u}{\left ( 1+\tan^2 u \right )\left ( 1+\tan^r u \right )}\, {\rm d}u \\ 
 &=\int_{0}^{\pi/2}\frac{{\rm d}u}{1+\tan^r u} \\ 
 &= \int_{0}^{\pi/2}\frac{{\rm d}u}{1+\cot^r u}
\end{align*}$$
Since $\cot u = 1/\tan u$ the last integral is evaluated easily again at $\pi/4$. 
A third approach would be to kill it directly with the sub $u=1/x$ which leads to, if we name the initial integral $I$,
$$I= \frac{\pi}{2}-I$$
and the result follows.
Now, what I am interested in here is to evaluate this using contour integration. I have a feeling that the contour will be a wedge shaped contour with some angle, let me call that $\omega$, but that $r$ cause some problems. Therefore I don't know how to integrate it using complex analysis. Any help appreciated.

(Edited to allow for singularity at $z=-1$.)
We wish to find
$$\int_0^\infty \frac{1}{(1 + x^2)(1 + x^r)} \mathrm{d}x$$
by contour integration. We can see that the integral along an arc with $|z|=R$ will tend to zero as $R\rightarrow\infty$. We also know we want the integral along the real axis, and we see that we may be able to draw symmetry between the negative and positive real axis, so we may consider the arc of angle $0\leq\theta\leq\pi$ joined by the line segment $[-R,R]$. However, for $r=3,5,7\ldots$ we see there is a singularity at $z=-1$, so we instead integrate along the arc of radius $R$ and angle $0\leq\theta\leq\pi-\epsilon$ where $\epsilon\ll1$, and the line segments $[-Re^{-\epsilon i},0]$ and $[0,R]$. We call the union of these lines $\Gamma$ as shown below and we later take the limits $R\rightarrow\infty$ and $\epsilon\rightarrow0$.

Since we wish to draw symmetries between the positive and negative real line we consider the integral
$$\int_\Gamma f(z) \mathrm{d}z, \qquad f(z)=\frac{1}{(1+z^2)\big( 1 + (z^2)^{r/2} \big)}.$$
The singularities of $f$ are at $z^2=-1$ and $z^r=-1$, which gives the points $z=i$ (shown on diagram), $z=-i$, $z=\exp(i\pi(1+2k)/r)$ for $k=0,1,\ldots,r-1$. We calculate the residues of the singularities that lie inside the domain bounded by $\Gamma$:
$$\begin{align}
\mathrm{res}(f; i) &= \frac{1}{2i\big( 1 + (-1)^{r/2} \big)} \\
  &= \frac{1}{2i\big( 1 + e^{i\pi r/2} \big)} \\
  &= \frac{1 + e^{-i\pi r/2}}{4i( 1 + \cos(\pi r/2))} \\
\mathrm{res}\Big( f; \exp\Big( \frac{i\pi}{r}(1+2k) \Big) \Big) &= \frac{1}{\big( 1+e^{2i\pi(1+2k)} \big) re^{i\pi(r-1)(1+2k)/r}} \\
  &= \frac{1}{-2r \cos(\pi(1+2k)/r)}
\end{align}$$
Note that all of the residues arising from $z^r=-1$ are real, so by Cauchy's residue theorem we obtain
$$\int_\Gamma f(z) \mathrm{d}z = \frac{\pi}{2} + i\xi$$
where $\xi\in\mathbb{R}$, and we should in fact find that the real parts of the residues cancel out when added, giving $\xi=0$.
We next parameterise the arc (which we call $\gamma$) by $z=Re^{i\theta}$, to see that
$$\begin{align}
\left| \int_\gamma f(z) \mathrm{d}z \right| &= \left| \int_0^{\pi-\epsilon} \frac{1}{(1 + R^2e^{2i\theta})(1 + R^re^{ir\theta})} \mathrm{d}\theta \right| \\
  &\leq (\pi-\epsilon) R \frac{1}{R^2 - 1} \rightarrow 0 \quad \mathrm{as} \quad R\rightarrow\infty,
\end{align}$$
where we have used the fact the arc length is $(\pi-\epsilon) R$, and the reverse triangle inequality in the last inequality.
Finally, taking $R\rightarrow\infty$ and parameterising $z$ along the line intervals as $z=e^{-\epsilon i}x$ and $z=x$, we are left with
$$\begin{align}
\frac{\pi}{2} + i\xi &= \int_\Gamma f(z) \mathrm{d}z \\
  &= \int_{-\infty}^0 \frac{e^{-\epsilon i}}{\big( 1 + \big( e^{-\epsilon i}x \big)^2 \big) \big( 1 + \big( e^{-2\epsilon i}x^2 \big)^{r/2} \big)} \mathrm{d}x + \int_{0}^\infty \frac{1}{(1 + x^2)\big( 1 + (x^2)^{r/2} \big)} \mathrm{d}x.
\end{align}$$
The last step is to take the limit $\epsilon\rightarrow0$ to obtain
$$\int_{-\infty}^0 \frac{1}{(1 + x^2)\big( 1 + (x^2)^{r/2} \big)} \mathrm{d}x + \int_{0}^\infty \frac{1}{(1 + x^2)\big( 1 + (x^2)^{r/2} \big)} \mathrm{d}x = \frac{\pi}{2} + i\xi,$$
where we must have $\xi=0$ since the left-hand side is real, and substituting $-x$ for $x$ in the first integral gives
$$2\int_{0}^\infty \frac{1}{(1 + x^2)\big( 1 + (x^2)^{r/2} \big)} \mathrm{d}x = \frac{\pi}{2}$$
and the required result follows.
