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

Could you give me a hint on how to find $$\int \frac{x+1}{(x^2-x+8)^3}\, dx$$ It doesn't seem like partial fractions are the way to go with here and using the integration by parts method seems to be tedious. I have also tried substituting $(x^2-x+8)$ but it gets even more complicated then. Is there a way to solve this using only basic formulas?

$$\int \frac{x+1}{\left(x^2-x+8\right)^3}\, dx=\frac{1}{2}\left(\int \frac{d\left(x^2-x+8\right)}{\left(x^2-x+8\right)^3}+\int\frac{3}{\left(x^2-x+8\right)^3}\, dx\right)$$

$$=\frac{1}{2}\left(\frac{1}{-2\left(x^2-x+8\right)^2}+96\int \frac{d(2x-1)}{\left((2x-1)^2+31\right)^3}\right)$$

Let $2x-1=\sqrt{31}\tan t$. Then $d(2x-1)=\frac{\sqrt{31}}{\cos^2 t}\, dt$.

$$\int \frac{d(2x-1)}{\left((2x-1)^2+31\right)^3}=\frac{1}{961\sqrt{31}}\int \cos^4 t\, dt$$

$$=\frac{1}{961\sqrt{31}}\int \left(\frac{1+\cos (2t)}{2}\right)^2 \, dt$$

$$=\frac{1}{3844\sqrt{31}}\left(\int dt+\int \cos(2t)\, d(2t)+\int \frac{1+\cos(4t)}{2}\, dt\right)$$

$$=\frac{1}{3844\sqrt{31}}\left(t+\sin(2t)+\frac{t}{2}+\frac{\sin(4t)}{8}\right)+C$$

We don't need to use any integration by parts.

We start by completing the square $$\int \frac{x+1}{(x^2-x+8)^3} dx = \int \frac{x-\frac{1}{2}+\frac{3}{2}}{((x-\frac{1}{2})^2+\frac{31}{4})^3} dx =$$ $$\underbrace{ \int \frac{x-\frac{1}{2}}{((x-\frac{1}{2})^2+\frac{31}{4})^3} dx}_{=:I_1}+ \frac{3}{2}\underbrace{\int\frac{1}{((x-\frac{1}{2})^2+\frac{31}{4})^3}dx}_{=:I_2}$$

For $I_1$ substitution $(x-\frac{1}{2})^2 = t$ then $\frac{dt}{dx}= 2(x-\frac{1}{2})$ so $$I_1 = \frac{1}{2}\int \frac{1}{t^3}dt = -\frac{1}{4t^2}+C$$ For $I_2$ first substitution $x-\frac{1}{2}=t$ $$I_2 = \int \frac{1}{(t^2+\frac{31}{4})^3}dt$$ then rearrange $$\int \frac{1}{(t^2+\frac{31}{4})^3}dt = \frac{4^3}{31^3}\int \frac{1}{{\left(1+\left(\frac{2t}{\sqrt{31}}\right)^2\right)}^3}dt.$$

Now another substitution $\frac{2t}{\sqrt{31}}=z$ gives us the following $$\frac{4^3}{31^3}\int \frac{1}{{\left(1+\left(\frac{2t}{\sqrt{31}}\right)^2\right)}^3}dt = \left(\frac{4}{31}\right)^\frac{5}{2}\int \frac{1}{(1+z^2)^3}dz.$$

The last substitution $z=\tan{y}$ and $dz= \frac{1}{\cos^2y}dy$, and we get something much simpler $$\left(\frac{4}{31}\right)^\frac{5}{2}\int \frac{1}{(1+z^2)^3}dz = \left(\frac{4}{31}\right)^\frac{5}{2}\int \frac{1}{\cos^2y}\cos^6(y)dy= \left(\frac{4}{31}\right)^\frac{5}{2}\int \cos^4(y)dy$$

Now we use that $\cos^2 y = {1 + \cos(2y) \over 2}$ to show that $\cos^4 y = \frac{\cos(4y) + 4\cos(2y)+3}{8}$ and thus $$\left(\frac{4}{31}\right)^\frac{5}{2}\int \cos^4(y)dy = \left(\frac{4}{31^\frac{5}{2}}\right)\int (\cos(4y) + 4\cos(2y)+3)dy$$ which is easy to find. Now you have to go backwards with all the substitutions to get the result with variable $x$ only.

As a last resort, it amounts to being able to compute $$I_n=\int\frac{\mathrm d\mkern 1mu x}{(x^2-x+8)^n}$$ This sort of integrals can be calculated recursively. I'll show how to obtain a relation between $I_2$ and $I_3$. $I_1$ is standard, and is an $\arctan$ after a change of variable.

Integrate $I_2$ by parts, setting \begin{align*}u&=\frac1{(x^2-x+8)^2},&\mathrm d\mkern 1mu v&=\mathrm d\mkern 1mu x\\ \text{whence}\qquad \mathrm d\mkern 1mu u&=\frac{-2(2x-1)}{(x^2-x+8)^3}\mathrm d\mkern 1mu x,& v&=x \end{align*} This yields \begin{align*}I_2&=\frac{x}{(x^2-x+8)^2}+2\int\frac{(2x^2-x)}{(x^2-x+8)^3}\mathrm d\mkern 1mu x\\ &=\frac{x}{(x^2-x+8)^2}+2\int\frac{(2x^2-2x+16)+(x-8)}{(x^2-x+8)^3}\mathrm d\mkern 1mu x\\ &=\frac{x}{(x^2-x+8)^2}+4I_2+2\int\frac{x-8}{(x^2-x+8)^3}\mathrm d\mkern 1mu x\\ \end{align*} Now $$\int\frac{x-8}{(x^2-x+8)^3}\mathrm d\mkern 1mu x=\int\frac{\frac12(2x-1)-\frac{15}2}{(x^2-x+8)^3}\mathrm d\mkern 1mu x=-\frac1{4(x^2-x+8)^2}-\frac{15}2I_3$$ from which we deduce the relation $$15I_3-3I_2=\frac{2x-1}{(x^2-x+8)^2}.$$ Similarly, you can integrate $I_1$ by parts to obtain a relation between $I_2$ and $I_1$.

If you multiply the top by two and then add and subtract 1 you can split the integral up as ∫2x - 1 / (x^2 - x + 8)^3 dx + ∫ 3 / (x^2 - x + 8)^3 dx

There is nothing simple about this. My take would be to write $$\frac{x+1}{x^2-x+8}=\frac{x+1}{((x-1/2)^2+31/4)^3} =\frac12\,\frac{2(x-1/2)+3}{((x-1/2)^2+31/4)^3}\\ =\frac12\,\frac{2(x-1/2)}{((x-1/2)^2+31/4)^3} + \frac12\,\frac{3}{((x-1/2)^2+31/4)^3}$$ Now the first term is a straightforward substitution. The second one would require a couple rounds of integration by parts.

According to Wolfram Alpha, an antiderivative is given by $$\int \frac{x+1}{(x^2-x+8)^3}\, dx = \frac{\frac{(31 (18 x^3-27 x^2+246 x-599)}{(x^2-x+8)^2}+36 \sqrt{31} \arctan\left(\frac{2 x-1}{\sqrt{31}}\right)}{59582}+c.$$ So you cannot expect anything too straightforward.