using contour integration I am trying to understand using contour integration to evaluate definite integrals. I still don't understand how it works for rational functions in $x$. So can anyone please elaborate this method using any particular function like say $\int_0^{\infty} \frac {1}{1+x^3} \ dx$. I'ld appreciate that.
I meant I know what I should be doing but am having problems applying them. So, basically I am interested in how to proceed rather than "Take this contour and so on". 
I'ld appreciate any help you people can give me. Thanks.

What we really need for contour integration by residues to work is a closed contour.  An endpoint of $\infty$ doesn't matter so much because we can treat it as a limit as $R \to \infty$, but an endpoint of $0$ is a problem.  Fortunately, this integrand is symmetric under rotation by $2 \pi/3$ radians.  So we consider a wedge-shaped contour $\Gamma = \Gamma_1 + \Gamma_2 + \Gamma_3$ going in a straight line $\Gamma_1$ from $0$ to $R$ on the real axis, then a circular arc $\Gamma_2$ on $|z|=R$ to $R e^{2\pi i/3}$, then a straight line $\Gamma_3$ back to $0$.

We have
$$\eqalign{\int_{\Gamma_1} \dfrac{dz}{1+z^3} &= \int_0^R \dfrac{dx}{1+x^3} \cr
          \int_{\Gamma_3} \dfrac{dz}{1+z^3} &= -e^{2\pi i/3} \int_0^R \dfrac{dx}{1+x^3} 
= \dfrac{1 - \sqrt{3}i}{2}  \int_0^R \dfrac{dx}{1+x^3} 
\cr \left|\int_{\Gamma_2} \dfrac{dz}{1+z^3} \right| &\le \dfrac{CR}{R^3 - 1} \to 0\ \text{as $R \to \infty $}}$$ for some constant $C$.  Now $f(z) = \dfrac{1}{1+z^3} = \dfrac{1}{(z+1)(z-e^{\pi i/3})(z-e^{-\pi i/3})}$ has one singularity inside $\Gamma$, namely at $z = e^{\pi i/3}$ (if $R > 1$), a simple pole with residue $$\dfrac{1}{(e^{\pi i/3}+1)(e^{\pi i/3} - e^{-\pi i/3})} = -\dfrac{1}{6} - \dfrac{\sqrt{3}}{6} i $$
Thus 
$$ \dfrac{3 - \sqrt{3}i}{2} \int_0^\infty f(x)\ dx = \lim_{R \to \infty} \oint_\Gamma f(z)\ dz = 2 \pi i \left(-\dfrac{1}{6} - \dfrac{\sqrt{3}}{6} i\right)$$
$$ \int_0^\infty f(x)\ dx = \dfrac{4 \pi i}{3 - \sqrt{3} i} \left(-\dfrac{1}{6} - \dfrac{\sqrt{3}}{6} i\right) = \dfrac{2 \sqrt{3} \pi}{9} $$
