\(\frac{x-1}{x+1}-\frac{x^2+x-2}{x+1}=\frac{x+1}{x-1}-x-2\\ \Leftrightarrow\frac{x-1}{x+1}-\frac{\left(x-1\right)\cdot\left(x+2\right)}{x+1}=\frac{x+1}{x-1}-x-2\\ \Leftrightarrow\frac{x-1-\left(x-1\right)\cdot\left(x+2\right)}{x+1}=\frac{x+1}{x-1}-x-2\\ \Leftrightarrow\frac{-\left(x-1\right)\cdot\left(x+2-1\right)}{x+1}=\frac{x+1}{x-1}-x-2\\ \Leftrightarrow\frac{-\left(x-1\right)\cdot\left(x+1\right)}{x+1}=\frac{x+1}{x-1}-x-2\)
\(\Leftrightarrow-\left(x-1\right)=\frac{x+1}{x-1}-x-2\\ \Leftrightarrow-x+1=\frac{x+1}{x-1}-x-2\\ \Leftrightarrow1-x=\frac{x+1}{x-1}-x-2\\ \Leftrightarrow1=\frac{x+1}{x-1}-2\\ \Leftrightarrow x-1=x+1-2\cdot\left(x-1\right)\\ \Leftrightarrow x-1=3-x\\ \Rightarrow x=3-x+1\\ \Rightarrow x=4-x\\ \Rightarrow x+x=4\\\Rightarrow2x=4\\ \Rightarrow x=\frac{4}{2}=2\)