f(x)/g(x)=(x^3-1)(x^2-x-2)/[(x^2-1)(x^2+x+1)]
=(x-1)(x^2+x+1)(x-2)(x+1)/[(x-1)(x+1)(x^2+x+1)]
=x-2
f(x)/g(x)=x-2=ax+b
a=1,b=-2
f(x)/g(x)=(x^3-1)(x^2-x-2)/[(x^2-1)(x^2+x+1)]
=(x-1)(x^2+x+1)(x-2)(x+1)/[(x-1)(x+1)(x^2+x+1)]
=x-2
f(x)/g(x)=x-2=ax+b
a=1,b=-2