Integration by partial-fractions, I´m stuck in this one. I don´t really know how get the factors in the denominator which allow me to use a case
$\int\frac{x^2+1}{x^2-x} dx$

$$\frac{x^2+1}{x^2-x}=\frac{x^2}{x^2-x}+\frac{1}{x^2-x}$$
$$=\frac{x^2}{x(x-1)}+\frac{1}{x(x-1)}$$
$$=\frac{x}{(x-1)}+\frac{1}{x(x-1)}$$
$$=\frac{x-1+1}{(x-1)}+\frac{1}{x(x-1)}$$
$$=1+\frac{1}{(x-1)}+\frac{1}{x(x-1)}$$
now let
$$\frac{1}{x(x-1)}=\frac{A}{x}+\frac{B}{x-1}$$
equate the two sides to find
$$A=-1$$
$$B=1$$
so
$$=1+\frac{1}{(x-1)}+\frac{1}{(x-1)}-\frac{1}{x}$$
$$=1+\frac{2}{(x-1)}-\frac{1}{x}$$
