\(ĐK:x\ne\pm1\)
Với \(\left[{}\begin{matrix}x>1\\x< -1\end{matrix}\right.\Leftrightarrow A=\dfrac{x+2}{x^2-1}+\dfrac{x^2}{x+1}=\dfrac{x+2+x^3-x^2}{\left(x-1\right)\left(x+1\right)}\)
Với \(-1< x< 1\Leftrightarrow A=\dfrac{x+2}{1-x^2}+\dfrac{x^2}{x+1}=\dfrac{x+2+x^3-x^2}{\left(x+1\right)\left(1-x\right)}\)
\(B=2x\cdot\dfrac{2}{x}+x^2+2x+1\left(x\ne0\right)=x^2+2x+5\)