So here we have the integral:
#int 1/(x^2-2x+2)^2 dx#
And the form of quadratic reciprocal seems to suggest that trigonometric substitution would work here. So first complete the square to get:
#x^2-2x+2 = (x-1)^2 +1#
Then apply the substitution #u = x-1# to remove the linear:
#(du)/dx = 1#
#rArr du = dx#
So we can safely change variables with no unwanted side-effects:
#int 1/(x^2-2x+2)^2 dx#
#= int 1/((x-1)^2 +1)^2 dx#
#-= int 1/(u^2 + 1)^2 du#
Now, this is the ideal form for executing a trigonometric substitution; #u^2 + 1# suggests the Pythagorean Identity #1 + tan^2theta = sec^2theta#, so we apply the substitution #u = tantheta# to simplify the denominator:
#(du)/(d theta) = sec^2 theta#
#rArr du = sec^2 theta d theta#
So the integral becomes:
#int 1/(sec^2 theta)^2 * sec^2 theta d theta#
#= int 1/(sec^2 theta) d theta#
#-= int cos^2 theta d theta#
Now, we use the double-angle formula for #cos# to make this antiderivative more manageable:
#cos(2theta) = 2cos^2 theta - 1#
#hArr cos^2 theta = 1/2(cos(2 theta) + 1)#
Then put that into the integral:
#1/2 int cos(2 theta) + 1 d theta#
#=1/2 ( theta + 1/2 sin(2 theta)) + c# (and reopening this with the double-angle formula for #sin#)
#=1/2 theta + 1/2sinthetacostheta + c#
Now, #x-1 = u = tan theta#
#rArr theta = arctan(x-1)#
#1 + (x-1)^2 = sec^2 theta#
#rArr cos theta = 1/sqrt(x^2 - 2x +2)#
#sin theta = tan theta*cos theta#
#rArr sin theta = (x-1)/(sqrt(x^2+2x+2)#
#:. sintheta*costheta = (x-1)/(x^2-2x+2)#
Finally, getting to the point:
#int 1/(x^2-2x+2)^2 dx#
# = 1/2arctan(x-1) + (x-1)/(2(x^2-2x+2)) + c#