$$\int_{-\infty}^{\infty}\frac{dx}{(x^2+2)^3}$$
I know that I can use a complex function $f(z)$ and I must deal with: $$\int_{-\infty}^{\infty}\frac{dz}{(z^2+2)^3}$$
So I need the roots of $z$
$$z_0 = i\sqrt2, z_1 = - i \sqrt 2$$
And only work with $z_0$
$$Res(f(z),z_0) = \frac{1}{2} \lim_{z \to i\sqrt2}\frac{d^2}{dz^2}\left[(z-i\sqrt 2)^3 \frac{dz}{(z^2 + 2)^3}\right]$$
Is this the way to go?
Well yes , that is the way to go but you've made mistakes when evaluating the poles. I would write it a little bit different. Consider the function $\displaystyle f(z)=\frac{1}{(z^2+3)^3}$. In the upper half plane we you have only one pole , namely $z=i\sqrt{3}$ of order $3$. The residue there is
$$\mathfrak{Res}\left ( f; i \sqrt{3} \right )= \frac{1}{2}\lim_{z \rightarrow i \sqrt{3}} \frac{\mathrm{d^2} }{\mathrm{d} z^2} \left ( z-i \sqrt{3} \right )^3 f(z)= -\frac{i}{48 \sqrt{3}}$$
Now choose a semicircle as you contour in the upper half plane. The contour integral of $f$ is
$$\oint \limits_{C} f(z) \, {\rm d}z = -2\pi i \cdot \frac{i}{48 \sqrt{3}}= \frac{\pi}{24 \sqrt{3}}$$
The integral of the arc vanishes. (leave the details to you). Thus:
$$\int_{-\infty}^{\infty} \frac{{\rm d}x}{\left ( x^2+3 \right )^3} = \frac{\pi}{24 \sqrt{3}}$$