Contour integration + paramerization of $\frac{1}{x^4+1}$ there is this question use contour integration to calculate  . Let  and consider the following loop contour 

 In the limit RA →∞, derive expressions for $\int_Af(z)dz$$,$$\int_Bf(z)dz$$,\int_Cf(z)dz$ in terms of the real integral I defined above. Hence, use the residue theorem to find I.
My attempts:
I managed to use residue theorem to get (ipisqrt(2))/4 - (pisqrt(2))/4 as e^(ipi/4) is the only pole that lies in this loop. Now I know 
(ipisqrt(2))/4 - (pisqrt(2))/4 =  $\int_Af(z)dz$$+$$\int_Bf(z)dz$$+\int_Cf(z)dz$ where
$\int_Cf(z)dz$ =  .  
I tried to parameterize the 1st and 2nd term of the right hand side using z=re^(itheta) but it ends up in a very complicated expression which I have no idea how to proceed from there. So what should I do to find the expressions for the 1st and 2nd terms of the right hand side?? Thanks
 A: For the contour labelled $A$, we use the parameterization $z=Re^{i\phi}$.  If $R>1$, then we have 
$$\begin{align}
\left|\int_A \frac1{1+z^4}\,dz\right|&=\left|\int_0^{\pi/2} \frac{iRe^{i\phi}}{1+R^4e^{i4\phi}}\,d\phi\right|\\\\
&\le \int_0^{\pi/2}\left|\frac{iRe^{i\phi}}{1+R^4e^{i4\phi}}\right|\,d\phi\\\\
&=\int_0^{\pi/2}\frac{R}{|R^4-1|}\,d\phi\\\\
&= \int_0^{\pi/2}\frac{R}{R^4-1}\,d\phi\\\\
&=\frac{\pi R/2}{R^4-1}\to 0 \,\,\text{as}\,\,R\to \infty
\end{align}$$
where we used the triangle inequality $|z^4+1|\ge ||z^4|-1|$

For the contour $B$, note that $z=iy$ so that
$$\begin{align}
\int_B \frac{1}{z^4+1}\,dz&=\int_R^0 \frac{1}{1+y^4}\,i\,dy\\\\
&=-i \int_0^R \frac1{1+x^4}\,dx\to -i\int_0^\infty \frac{1}{x^4+1}\,dx\,\,\text{as}\,\,R\to \infty 
\end{align}$$
Can you finish now?
A: an other way is $$x^4+1+2x^2-2x^2=(x^2+1)^2-2x^2=(x^2+1-\sqrt{2}x)(x^2+1+\sqrt{2}x)$$
A: Try instead using the entire upper half plane rather than just the first quadrant, then exploit symmetry of the integrand on the real line.  This avoids having to integrate along path $B$.  You need to calculate an additional residue, but this is easy.  Then you justify that the integral along path $C$ vanishes as the radius tends to infinity, leaving you with the desired integrand.
