# Evaluate $\int \frac{x^4 + 1}{(x^4 - 1)^2}dx$

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.

• Parts isn't so bad here---using the fact that the integrand is invariant under $x \mapsto i x$ reduces the computation of 8 coefficients to a system in just $2$ coefficients. Oct 24, 2023 at 4:29

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$$.

• Wasn't able to notice this decomposition. Oct 24, 2023 at 5:02
• I did the first rewriting (= use $(x^2+1)^2+(x^2-1)^2=2(x^4+1)$ often done with halved exponents), and then decided to take a look at the answers :-) Oct 24, 2023 at 5:08

By integration by parts, we have \begin{aligned}\int \frac{x^4+1}{\left(x^4-1\right)^2} d x & = -\frac{1}{4}\int \frac{x^4+1}{x^3} d\left(\frac{1}{x^4-1}\right)\\ & =-\frac{1}{4}\left(x+\frac{1}{x^3}\right) \frac{1}{x^4-1}+\frac{1}{4} \int\left(1-\frac{3}{x^4}\right)\frac{ 1}{ x^4-1} d x \\ & =-\frac{x^4+1}{4 x^3\left(x^4-1\right)}+\frac{1}{4} \int \frac{d x}{x^4-1}-\frac{3}{4} \int\left(\frac{1}{x^4-1}-\frac{1}{x^4}\right) dx\\ & =-\frac{x^4+1}{4 x^3\left(x^4-1\right)}-\frac{1}{2} \int \frac{d x}{x^4-1}-\frac{1}{4 x^3}+C \\ & =-\frac{x}{2\left(x^4-1\right)}+\frac{1}{8} \ln \left|\frac{x+1}{x-1}\right|+\frac{1}{4} \tan ^{-1} x+C \\ & \end{aligned}

Using partial fraction decomposition $$\frac{x^4 + 1}{(x^4 - 1)^2}=\frac{1}{2 \left(x^2+1\right)^2}+\frac{1}{8 (x+1)}+\frac{1}{8 (x+1)^2}-\frac{1}{8 (x-1)}+\frac{1}{8 (x-1)^2}$$ All integrals are simple (the first one just requires one integration by parts).