I'm trying to solve this irrational integral $$ \int \frac{x-4}{\sqrt{x^2-4x+5}}\, dx$$ doing the substitution
$$ x= \frac{5-t^2}{2 \cdot (2+t)}$$ according to the rule.
So the integral becomes:
$$ \int \frac{1}{2} \cdot \frac{t^2+8t+11}{t^2+4t+5}\, dt =\frac{1}{2} \int 1+\frac{4t+7}{t^2+4t+5}\, dt= \frac{1}{2}t+2 \ln (t+2)+\frac{1}{2}\frac{1}{t+2} + cost$$ with $t=-x+ \sqrt{x^2-4x+5}$
The final result according to my book is instead $\sqrt{x^2-4x+5}-2 \ln( x-2+ \sqrt{(x-2)^2+1})$
I don't understant why this difference. Can someone show me where I'm making mistakes?