ĐK: \(\hept{\begin{cases}x-1\ne0\\x+1\ne0\end{cases}\Rightarrow\hept{\begin{cases}x\ne1\\x\ne-1\end{cases}}}\)
\(\Leftrightarrow\frac{\left(ax-1\right)\left(x+1\right)+b\left(x-1\right)}{\left(x-1\right)\left(x+1\right)}=\frac{a\left(x^2+1\right)}{\left(x-1\right)\left(x+1\right)}\)
\(\Leftrightarrow\left(ax-1\right)\left(x-1\right)+b\left(x-1\right)=a\left(x^2+1\right)\)
\(\Leftrightarrow ax^2-ax-x+1+bx-b=ax^2+a\)