# `int (8x) / (x^3+x^2-x-1) dx` Use partial fractions to find the indefinite integral

`int(8x)/(x^3+x^2-x-1)dx`

`(8x)/(x^3+x^2-x-1)=(8x)/((x^3+x^2)-1(x+1))`

`=(8x)/((x^2(x+1)-1(x+1)))`

`=(8x)/((x+1)(x^2-1))`

`=(8x)/((x+1)(x+1)(x-1))`

`=(8x)/((x-1)(x+1)^2)`

Now let's form the partial fraction template,

`(8x)/((x-1)(x+1)^2)=A/(x-1)+B/(x+1)+C/(x+1)^2`

Multiply the equation by the denominator,

`8x=A(x+1)^2+B(x-1)(x+1)+C(x-1)`

`8x=A(x^2+2x+1)+B(x^2-1)+C(x-1)`

`8x=Ax^2+2Ax+A+Bx^2-B+Cx-C`

`8x=(A+B)x^2+(2A+C)x+A-B-C`

Comparing the coefficients of the like terms,

`A+B=0`      -----------------(1)

`2A+C=8`   -----------------(2)

`A-B-C=0`  ---------------(3)

From equation 1,

`B=-A`

Substitute B in equation 3,

`A-(-A)-C=0`

`2A-C=0`      ---------------(4)

Now add equations 2 and 4,

`4A=8`

`A=8/4`

`A=2`

`B=-A=-2`

Plug in the value of A in equation 4,

`2(2)-C=0`

`C=4`

Plug in the values of A, B and C in the partial fraction template,

`(8x)/((x-1)(x+1)^2)=2/(x-1)+(-2)/(x+1)+4/(x+1)^2`

`int(8x)/(x^3+x^2-x-1)dx=int(2/(x-1)-2/(x+1)+4/(x+1)^2)dx`

Apply the sum rule,

`=int2/(x-1)dx-int2/(x+1)dx+int4/(x+1)^2dx`

Take the constant out,

`=2int1/(x-1)dx-2int1/(x+1)dx+4int1/(x+1)^2dx`

Now let's evaluate the above three integrals separately,

`int1/(x-1)dx`

Apply integral substitution:`u=x-1`

`du=1dx`

`=int1/udu`

use the common integral `int1/xdx=ln|x|`

`=ln|u|`

Substitute back `u=x-1`

`=ln|x-1|`

Now let's evaluate second integral,

`int1/(x+1)dx`

Apply integral substitution: `u=x+1`

`du=dx`

`=int1/udu`

`=ln|u|`

Substitute back `u=x+1`

`=ln|x+1|`

Now evaluate the third integral,

`int1/(x+1)^2dx`

apply integral substitution: `u=(x+1)`

`du=dx`

`=int1/u^2du`

`=intu^(-2)du`

apply power rule,

`=u^(-2+1)/(-2+1)`

`=-1/u`

Substitute back `u=x+1`

`=-1/(x+1)`

`int(8x)/(x^3+x^2-x-1)dx=2ln|x-1|-2ln|x+1|+4(-1/(x+1))`

Simplify and add a constant C to the solution,

`=2ln|x-1|-2ln|x+1|-4/(x+1)+c`