help contour integral and residue theorem compute 
$$J= \int_\infty^\infty \frac{dx}{x^3-8i}$$
simplify your answer until you get a purely imaginary number
When I initially started this question, I put $z^3$ and $8i$ into polar form and got $\theta$ = $\frac{\pi}{2} + \frac{2k\pi}{3}$ where $k = 0,1,2$ so 
$$ 2e^{i\pi\left(\frac{1}{2} + \frac{2k}{3}\right)}$$
However I am unsure of how to use this within the residue theorem and to solve to get the answer. 
 A: Ok, so our integrand is $$
  f(z) = \frac{1}{z^3 - i8}
$$
The first order of business is to find the poles of $f(z$). In this case, those are simply the zeros of the denominator, i.e. the solutions of $z^3 = i8$. If $z=re^{i\varphi}$, i.e. if $z$ is expressed in polar coordinates, we know that $z^n = r^ne^{i\varphi n}$, so what we have to do is solve $$
  r^3 = 8 \quad\text{ and }\quad 3\varphi = \frac{\pi}{2} \mod {2\pi}
$$ 
with the understanding that we only care for solutions $\varphi \in [0,2\pi)$ since $\varphi$ is supposed to be an angle. That yields the three poles $$
  p_1 = 2e^{i\frac{\pi}{6}}, p_2 = 2e^{i\frac{5\pi}{6}}, p_3 = 2e^{i\frac{9\pi}{6}} = -i2 \text{.}
$$
Two of these poles ($p_1,p_2$) lie in the upper half plane and one in the lower half plane ($p_3$).
We now pick our contour. We let $\gamma_N$ be the path that goes from $-N$ to $N$ along the real axis, and then back to $-N$ along a half circle in the lower half plane. Let $C_N$ be that circle. Obviously, as $N$ gets larger, the part of $\gamma_N$ along the real axis approximates the integral we actually want to compute better and better. But what about the circle? We need to show that the integral along that goes to zero as $N \to \infty$. We have that $$
  |f(z)| = \frac{1}{|z - i8|^3} \leq \frac{1}{|z|^3 - 8^3} \text{if $|z| > 8$} \text{.}
$$
From that, we get (using that the length of $C_N$ is $\pi N$, and that all $z$ along $C_N$ have absolute value $N$) $$
  \left|\int_{C_N} f(z) \,dz\right| < \frac{\pi N}{N^3 - 24} \to 0 \text{ as $N \to \infty$.}
$$
Our contour $\gamma_N$ (for large enough $N$) includes exactly one pole - $p_3$ - and so we can conclude that $$
  \int_{-\infty}^\infty f(x) \,dx = \lim_{N \to \infty} \oint_{\gamma_N} f(z) \,dz = -i2\pi\textrm{Res }(f, p_3)
$$
where the minus sign accounts for the fact that our contour goes around $p_3$ clockwise, not counter-clockwise.
So all that remains is to compute the residue of $f(z)$ at $p_3$. For that, we have multiple options. One would be to do a partial fraction decomposition of $\frac{1}{z^3 - i8}$, which would yield the residues at all of the three poles at once. But we only need the residue at the pole $p_3$, so we can save ourselves some work. Since the pole of $f$ at $p_3$ has order one, we know that $$
  g(z) = (z - p_3)f(z)
$$
is holomorphic at $p_3$, and therefore has a taylor series expansion around $p_3$, say $g(z) = \sum_{k=0}^\infty g_k(x - p_3)^k$. It follows $f$ has the laurent series expansion $$
  f(z) = \sum_{k=-1}^\infty g_{k+1}(x - p_3)^k
$$
around $p_3$, and the residue of $f$ at $p_3$ is then $$
  \textrm{Res }(f, p_3) = g_0
$$
since $g_0$ is the coefficient of $(x - p_3)^{-1}$ in that laurent series expansion. So all we have to do is find the first coefficient of $g$'s taylor series expansion around $p_3$, which is simply $g_0 = g(p_3)$. But we must be carefully when evaluating $g$ there, because direct evaluation obviously yields the indeterminate form $0\cdot\infty$. But we can use l'hospital's rule to find $$
  \textrm{Res }(f, p_3) = \lim_{z\to p_3}(z - p_3)f(z) = \lim_{z\to p_3}\frac{z - p_3}{z^3 - i8} = \lim_{z\to p_3} \frac{1}{3z^2} = \frac{1}{3(-2i)^2} = -\frac{1}{12} \text{.}
$$
So finally we found that $$
  \int_{-\infty}^\infty \frac{1}{z^3 - i8} = i2\pi\frac{1}{12} = i\frac{\pi}{6} \text{.}
$$

The same way of computing the resiude always works if the pole has order $1$. In other words, if $$
  f(z) = \frac{g(z)}{h(z)}
$$
where $h$ has a zero of degree $1$ at $p$ and $g(p) \neq 0$ then $$
  \textrm{Res }(f, p) = \lim_{z\to p} (z - p)f(z) = \lim_{z\to p} \frac{(z-p)g(z)}{h(z)} = \frac{g(z) + (z-p)g'(z)}{h'(z)} \text{.}
$$
A: Define an appropiate contour, e.g. the upper half plane (consider it as a half circle), and compute the integral over it by the use of Cauchy's residue theorem. The integral over the circle arc vanishes (it is essentially $r^{-3}$ times the length $\pi r$ for radius $r$). So you need the residue(s) at the singularities.
