#int dx qquad ln(x^2-x+2)#
we use IBP
#int u v' = uv - int u' v#
and the trick here is
#u = ln(x^2-x+2), u' = (2x-1)/(x^2-x+2)#
#v' = 1, v = x#
so we have
#xln(x^2-x+2) - int dx qquad x(2x-1)/(x^2-x+2) qquad star#
for #int dx qquad x(2x-1)/(x^2-x+2) # this becomes:
#int dx qquad (2x^2-x)/(x^2-x+2) #
next bit is like long division only easier
#= int dx qquad (2x^2-2x + 4 + x- 4)/(x^2-x+2) #
#= int dx qquad 2 + (x- 4)/(x^2-x+2) #
now we set it up for a log solution by setting up this pattern: #(f'(x)) / f(x)#
#= 2x + int dx qquad (1/2(2x- 8))/(x^2-x+2) #
#=2x + int dx qquad (1/2(2x- 1)-7/2)/(x^2-x+2) #
#= 2x + int dx qquad (1/2(2x- 1))/(x^2-x+2) - 7/2 1/(x^2-x+2) #
#= 2x + 1/2 ln(x^2-x+2) - 7/2 int dx qquad 1/(x^2-x+2) #
if we plug this all into #star# we have
#xln(x^2-x+2) - ( 2x + 1/2 ln(x^2-x+2) - 7/2 int dx qquad 1/(x^2-x+2) )#
#=(x- 1/2) ln(x^2-x+2) - 2x + 7/2 int dx qquad 1/(x^2-x+2) qquad square#
for # int dx qquad 1/(x^2-x+2) #
we complete the square, looking for a tan sub to finish it off, so
# int dx qquad 1/((x-1/2)^2 - 1/4 + 2) #
#= int dx qquad 1/((x-1/2)^2 + 7/4) #
#= int dx qquad 1/(7/4 tan^2 phi + 7/4) # using the sub #(x-1/2)^2 = 7/4 tan^2 phi# or #(x-1/2) = sqrt 7/2 tan phi#
so #dx = sqrt 7/2 sec^2 phi \ d phi#
#=sqrt 7/2 int d phi qquad sec^2 phi \ 1/(7/4 sec^2 phi ) #
#=2/ sqrt 7 int d phi qquad #
#=2/ sqrt 7 arctan (2 (x-1/2)/sqrt 7)#
parking this back into #square#
#=(x- 1/2) ln(x^2-x+2) - 2x + 7/2 2/ sqrt 7 arctan (2 (x-1/2)/sqrt 7)#
#=(x- 1/2) ln(x^2-x+2) - 2x + sqrt 7 arctan ( (2x-1)/sqrt 7)#