my computation of a real integral still has an imaginary number in it, I have four residues that I have found.  I multiplied each by $2\pi i$, using the Residue Theorem.  But my final answer still has an $i$ in it.  Needless to say, it is not the right answer, since the goal was to compute a real integral on $R^+$
What should I do with the four residues to try and catch my mistake?  I've expanded each one in its Euler formula, $\cos(x) + i \sin(x)$, computed a common denominator, so that I can combine all residue terms.  This led to a few cancellations, but ultimately still left me with an $i$ factor.  Am I proceeding in generally the correct way?  
Thanks,
EDIT: The integral is $$\int_0^\infty \frac{x^2logx}{1+x^4}dx$$
Here's a summary of my work:  the integrand has simple poles at 
$$e^{i\pi/4},e^{i3\pi/4},e^{i5\pi/4},e^{i7\pi/4}$$
and the residues are 
$$-\frac{\pi}{16ie^{i\pi/4}},-\frac{3\pi}{16ie^{i3\pi/4}},-\frac{5\pi}{16ie^{i5\pi/4}},-\frac{7\pi}{16ie^{i7\pi/4}}$$
finally, multiplying each by $2\pi i$, and adding up the four terms gives me (incorrectly) $$-\frac{\pi^2i}{\sqrt{2}}$$ I added the terms by expanding out all of the Euler formulas, and then combined the terms with a common denominator.  I've checked my work about 5 times now...still can't catch my mistake...
 A: We will evaluate the integral 
$$\color{blue}{\int_0^{\infty}\frac{x^2\log x}{x^4+1}dx}$$
by analyzing the integral $I$ defined as 
$$I=\oint_C\frac{z^2(\log z)^2}{z^4+1}dz$$
where the contour $C$ is the keyhole contour for which the "key hole" is along the positive real axis.  
The contributions to the integral from the circle of radius $R$ that enclosed the poles vanishes as $R\to \infty$.  Likewise, the contribution from the semi-circle with radius $\epsilon$ around the branch point at $z=0$ vanishes as $\epsilon \to 0$.  Thus, 
$$\begin{align}
I&=\int_0^{\infty} \frac{x^2 (\log x)^2}{x^4+1}dx+\int_{\infty}^0\frac{x^2 (\log x+i2\pi)^2}{x^4+1}dx\\\\
&=-i4\pi \color{blue}{\int_0^{\infty}\frac{x^2\log x}{x^4+1}dx}+4\pi^2\int_0^{\infty}\frac{x^2}{x^4+1} \tag 1
\end{align}$$
The first integral on the right-hand side of $(1)$ is the integral of interest.  The second integral can be evaluated in terms of elementary functions and is equal to $\pi\sqrt{2}/4$.  We also have that $I$ is 
$$I=2\pi i \sum_{k=1}^4 \text{Res}\left(\frac{z^2(\log z)^2}{z^4+1},z_k\right)$$
where $z_k=e^{i(2k-1)\pi/4}$, $k=1,2,3,4$, are the roots of $z^4=-1$.  The residues are given by 
$$\frac{(\log z_k)^2}{4z_k}$$
Can you finish from here?
SPOILER ALERT:

The sum of the residues, after pain-staking patience, are $\pi^2\sqrt{2}-i\frac{\pi^3\sqrt{2}}{4}$.  Thus, the integral of interest is $$\int_0^{\infty}\frac{x^2\log x}{x^4+1}dx=\frac{\pi^2\sqrt{2}}{16}$$

A: The following is an outline of the solution which is the most natural in my opinion.
Write$$A:=\int_0^\infty \frac{x^2\log x}{1+x^4}dx.$$A short calculation shows that$$\int_{-\infty}^0\frac{x^2\log x}{1+x^4}dx=A+i\pi\int_0^\infty\frac{t^2}{1+t^4}dt=A+i\pi\cdot\frac{\pi}{2\sqrt{2}}=A+\frac{i\pi^2}{2\sqrt{2}}.$$(the second left hand integral can be evaluated using either complex integration or standard real analysis methods).
Now consider paths which go along the whole real line with a small circular "jump" to avoid $0$, then draw a semicircle in the upper half plane. The contribution of the semicircle vanishes at infinite radius, and the contribution of the circular jump vanishes at $0$ radius. The integral$$\int_\gamma\frac{z^2\log z}{1+z^4}dz$$along the above described kind of path can be evaluated by considering the residues at the two upper poles of the function.
