Problem: $$ \int \frac{x^4 + 1}{(x^4 - 1)^2} dx $$
I know this problem can be done with partial fractions, but it is very tedious that way. I tried two ways to do this, one does the job but is still very tedious the other doesn't really work but I thought it would.
My second attempt was
$$ \int \frac{x^4 + 1}{(x^4 - 1)^2} dx = \int \frac{(2x + \frac{2}{x^3})}{2x(x^2 - \frac{1}{x^2})^2} dx $$
Substitute $x^2 - \frac{1}{x^2} = t$ so that $dt = 2x + \frac{2}{x^2}$ and $x = \pm \sqrt{\frac{t \pm \sqrt{t^2 + 1}}{2}}$. Which doesn't really simplify the integral.
My other attempt was to convert this into two integrals that I have solved before
$$ \int \frac{x^4 + 1}{(x^4 - 1)^2}dx = \int \frac{x^4 - 1 + 2 }{(x^4 - 1)^2}dx = \int \frac{1}{x^4 - 1} dx + \int \frac{2}{(x^4 - 1)^2} dx = I + J $$
Using by parts for the first one, we obtain
$$I = \frac{x}{x^4 - 1} + 4 \int \frac{x^4}{(x^4 - 1)^2}dx = \frac{x}{x^4 - 1} + 4 \int \frac{1}{(x^4 - 1)}dx + 4\int \frac{1}{(x^4 - 1)^2}dx = \frac{x}{x^4 - 1} + 4I + 4J$$
Which can be easily solved. However if there's a simple method to tackle this integral I would be delighted.
Rewriting gives \begin{align}\int \frac{x^4 + 1}{(x^4 - 1)^2} \, dx &= \frac{1}{2} \int \left[\frac{1}{(1 + x^2)^2} + \frac{1}{(1 - x^2)^2}\right] \,dx \\ &= \frac{1}{4} \left(\frac{x}{1 + x^2} + \arctan x + \frac{x}{1 - x^2} + \operatorname{artanh} x\right) + C \\ &= - \frac{1}{2} \frac{x}{x^4 - 1} + \frac{1}{4} \left(\arctan x + \operatorname{artanh} x\right) + C \end{align} The integrals $\int \frac{dx}{(1 \pm x^2)^2}$ in the second expression can both be evaluated immediately via integration by parts.
As usual, the above antiderivatives are defined on the domain $(-1, 1)$ of $\operatorname{artanh} x$. Elsewhere, replace that term with $\operatorname{arcoth} x$.