Answer
$y=\frac{x-1}{x+1}(x-2\ln |x+1|+C)$
Work Step by Step
We are given:
$$(x^2-1)(y'-1)+2y=0$$
$$x^2y'-x^2-y'+1+2y=0$$
$$y'+\frac{2y}{x^2-1}=1$$
Integrating factor:
$$I=e^{\int\frac{2y}{x^2-1}dx}=e^{\int\frac{2y}{(x-1)(x+1)}dx}=e^{\int\frac{1}{x-1}-\frac{1}{x+1}dx}=e^{\ln |x-1|-\ln |x+1|}=e^{\frac{x-1}{x+1}}=\frac{x-1}{x+1}$$
The equation becomes:
$$\frac{d}{dx}(y\frac{x-1}{x+1})=\frac{x-1}{x+1}$$
Integrating both sides:
$$y\frac{x-1}{x+1}=x-2\ln|x+1|+C$$
$$y=\frac{x-1}{x+1}(x-2\ln |x+1|+C)$$
The general solution is:
$$y=\frac{x-1}{x+1}(x-2\ln |x+1|+C)$$