\(D=\left(\dfrac{1}{x-1}-\dfrac{x+1}{1-x^2}\right):\left(2-\dfrac{x-4}{x-1}\right)\);\(x\ne\pm1\)
\(D=\dfrac{x+1+x+1}{\left(x-1\right)\left(x+1\right)}:\dfrac{2x-2-x+4}{x-1}\)
\(D=\dfrac{2\left(x+1\right)}{\left(x-1\right)\left(x+1\right)}:\dfrac{x+2}{x-1}\)
\(D=\dfrac{2}{x-1}.\dfrac{x-1}{x+2}\)
\(D=\dfrac{2}{x+2}\)