$\int_{-\infty}^{\infty }\frac{x^{2} \, dx}{x^{4}+a^{4}}$ I'm considering the following integral:
$$\int_{-\infty}^{\infty }\frac{x^{2} \, dx}{x^{4}+a^{4}}$$
I do not know how to factor the denominator to calculate the residues.
I'm stuck here:
$$(x^{2}-|a|^{2}i)(x^{2}+|a|^{2}i)$$
Thank you so much.

Find the indefinite integral.
First, determine constants $p, q, r, s$ such that
$$
\frac{px+q}{x^2+\sqrt{2}ax+a^2}+\frac{rx+s}{x^2-\sqrt{2}ax+a^2} = \frac{x^2}{x^4+a^4}
$$
By comparing the coefficients of $x^3, x^2, x, 1$, we have the following relational expression:
$$
p+r=0, \\
-\sqrt{2}a(p-r)+q+s=1, \\
a^2(p+r)-\sqrt{2}a(q-s)=0, \\
(q+s)a^2=0
$$
Thus, $p=-\frac{1}{2\sqrt{2}a}, \ q=0, \ r=\frac{1}{2\sqrt{2}a}, \ s=0$.
Based on those,
$$
\int \frac{x^2}{x^4+a^4}dx \\
= \int \left\{ -\frac{\frac{1}{2\sqrt{2}a}(x+\frac{\sqrt{2}}{2}a)}{x^2+\sqrt{2}ax+a^2} + \frac{\frac{1}{2\sqrt{2}a}(x-\frac{\sqrt{2}}{2}a)}{x^2-\sqrt{2}ax+a^2} + \frac{1}{4}\frac{1}{x^2+\sqrt{2}ax+a^2} + \frac{1}{4}\frac{1}{x^2-\sqrt{2}ax+a^2} \right\} dx \\
= -\frac{1}{4\sqrt{2}a}\log{(x^2+\sqrt{2}ax+a^2)} + \frac{1}{4\sqrt{2}a}\log{(x^2-\sqrt{2}ax+a^2)} \\
+ \frac{1}{4}\int \left\{ \frac{1}{(x+\frac{1}{\sqrt{2}}a)^2+\frac{a^2}{2}} + \frac{1}{(x-\frac{1}{\sqrt{2}}a)^2+\frac{a^2}{2}} \right\} dx
$$
The remaining integral is,
$$
\frac{1}{4} \cdot \frac{2}{a^2} \int \left\{ \frac{1}{(\frac{\sqrt{2}}{a}x+1)^2+1} + \frac{1}{(\frac{\sqrt{2}}{a}x-1)^2+1} \right\} dx \\
= \frac{1}{2\sqrt{2}a} \left\{ \tan^{-1}(\frac{\sqrt{2}}{a}x+1) + \tan^{-1}(\frac{\sqrt{2}}{a}x-1) \right\} + Const.
$$
To sum up,
$$
\int \frac{x^2}{x^4+a^4}dx \\
= \frac{1}{4\sqrt{2}a}\log {\frac{x^2-\sqrt{2}ax+a^2}{x^2+\sqrt{2}ax+a^2}} + \frac{1}{2\sqrt{2}a} \left\{ \tan^{-1}(\frac{\sqrt{2}}{a}x+1) + \tan^{-1}(\frac{\sqrt{2}}{a}x-1) \right\} + Const.
$$
After that, check each item of the result when $x \rightarrow \infty$ or $-\infty$ and calculate.
