First we need to create partial fractions for

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

Multiplying both sides by `(x-1)(x^2+2)` and we get

`2x^2-2x+1=(Ax+B)(x-1)+C(x^2+2)=Ax^2+Bx-Ax-B+Cx^2+2C`

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

(1)A+C=2, (2) A-B=2 and (3)2C-B=1

C+B=0 (Subtracting 2 from 1) adding (3) we get 3C=1, so C=1/3

So ``````substituting C into (1) we get A=2-1/3 = 5/3

Substituting A into (2) we get B=5/3-2=-1/3

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

So now we are ready to integrate

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

The second integral is `1/3ln(x-1)`

The first we need to work on.

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

The first integral is easy we substutute u=x^2, so du=2xdx or 1/2du=xdx to get

`int(5x)/(3(x^2+2))dx=5/3int1/((u+2))1/2du=5/6ln(u+2)=5/6ln(x^2+2)`

The second part of the second integral is equal to

-1/3int(1/(x^2+2))dx we can substitute `x=sqrt(2)tanu` , `dx=sqrt(2)sec^2udu`

to get

`-1/3int(1/(2tan^2u+2))sqrt(2)sec^2udu=-sqrt(2)/3int(sec^2u)/(2(tan^2u+1))du`

Using the Pythagorean Identity `tan^2a+1=sec^2a` we get

`=-sqrt(2)/6 int(sec^2u)/(sec^2u)du=-sqrt(2)/6 int du = -sqrt(2)/6 u`

Since `u = arctan(x/sqrt(2))` we get that this integral equal `-sqrt(2)/6 arctan((sqrt(2)x)/2))`

So finally the entire integral is

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

`=1/3ln(x-1)+5/6ln(x^2+2)-sqrt(2)/6arctan(sqrt(2)/2x)+C`