a: \(=\dfrac{x^3-x^2-2x+x+1+x^2-1}{\left(x-1\right)\left(x+1\right)}\)
\(=\dfrac{x^3-x}{\left(x-1\right)\left(x+1\right)}=x\)
b: \(=\dfrac{4x^2+4xy+y^2-8xy+4x^2-4xy+y^2}{\left(2x+y\right)\left(2x-y\right)}=\dfrac{12x^2-8xy+2y^2}{\left(2x-y\right)\left(2x+y\right)}\)