We have to find what multiplied by x-2x−2 cancels x^4x4. In this case it is x^3x3. Multiplying by x^3x3 we get x^4-2x^3x4−2x3. We can then subtract this from the numerator to get
x^4+x^2+2-(x^4-2x^3)=2x^3+x^2+2x4+x2+2−(x4−2x3)=2x3+x2+2
Now we need to find a value that will cancel 2x^32x3. This value is 2x^22x2. Multiplying by this we get 2x^3-4x^22x3−4x2. Subtracting we get
2x^3+x^2+2-(2x^3-4x^2)=5x^2+22x3+x2+2−(2x3−4x2)=5x2+2
The value that will cancel out 5x^25x2 is 5x5x. Subtracting we get
5x^2+2-(5x^2-10x)=10x+25x2+2−(5x2−10x)=10x+2
To cancel out 10x10x we can us 1010.
10x+2-(10x-20)=2210x+2−(10x−20)=22
Since we can't divide anymore, 22 is the remainder. We add the remainder divided by the denominator to the rest of the terms we got to get
x^3+2x^2+5x+10+\frac{22}{x-2}x3+2x2+5x+10+22x−2