<s>[INST] Integral of $\int \frac{x^4+2x+4}{x^4-1}dx$ I am trying to solve this integral and I need your suggestions.
$$\int \frac{x^4+2x+4}{x^4-1}dx$$
Thanks
 [/INST] Welcome to Math Stack Exchange!
With lab bhattacharjee's helpful hint for the integral, we can rewrite the expression as:
$$\int \left(1 + \frac{(-2x - 5)}{2(x^2 + 1)} + \frac{7}{4(x - 1)} - \frac{3}{4(x + 1)}\right)dx$$
$$= \int 1 dx + \int \frac{(-2x - 5)}{2(x^2 + 1)} dx + \int \frac{7}{4(x - 1)} dx - \int \frac{3}{4(x + 1)} dx$$
$$= \int 1 dx - \int \frac{2x}{2(x^2 + 1)} dx - \int \frac{5}{2(x^2 + 1)} + \int \frac{7}{4(x - 1)} dx - \int \frac{3}{4(x + 1)} dx$$
$$= \int 1 dx - \int \frac{x}{x^2 + 1} dx - \frac{5}{2} \int \frac{1}{x^2 + 1} dx + \frac{7}{4} \int \frac{1}{x - 1} dx - \frac{3}{4} \int \frac{1}{x + 1} dx$$
Next steps should be "direct-cut", meaning that it's really possible to work out the computation one way! :D


*

*For the first integrand, use power rule to obtain $x$.

*For the second integrand, let $u = x^2 + 1 \rightarrow du = 2x dx$.

*For the third integrand, you get $\arctan(x)$.  You can find the special integral here.

*For the fourth integrand, let $v = x - 1 \rightarrow dv = dx$.

*For the fifth integrand, let $w = x + 1 \rightarrow dw = dx$.


So we are left off with:
$$x - \frac{5}{2}arctan(x) - \frac{1}{2} \int \frac{du}{u} + \frac{7}{4} \int \frac{dv}{v} - \frac{3}{4}  \int \frac{dw}{w}$$
Finally, the expression becomes...
$$x - \frac{5}{2}arctan(x) - \frac{ln(u)}{2} + \frac{7ln(v)}{4} - \frac{3ln(w)}{4} + K \text{ where } K \text{ is an arbitrary constant}$$
$$= x - \frac{5}{2}arctan(x) - \frac{ln(x^2 + 1)}{2} + \frac{7ln(x - 1)}{4} - \frac{3ln(x + 1)}{4} + K$$
The solution for the integral is equivalent to the one in Wolfram Alpha.
</s>