[tex]x^3=x\cdot x^2[/tex] and [tex]x^2(x-1)=x^3-x^2[/tex]. So we have a remainder of
[tex](x^3+1)-(x^3-x^2)=x^2+1[/tex]
[tex]x^2=x\cdot x[/tex] and [tex]x(x-1)=x^2-x[/tex]. Subtracting this from the previous remainder gives a new remainder
[tex](x^2+1)-(x^2-x)=x+1[/tex]
[tex]x=x\cdot1[/tex] and [tex]1(x-1)=x-1[/tex]. Subtracting this from the previous remainder gives a new one of
[tex](x+1)-(x-1)=2[/tex]
and we're done since 2 does not divide [tex]x[/tex]. So we have
[tex]\dfrac{x^3+1}{x-1}=x^2+x+1+\dfrac2{x-1}[/tex]