Polynomial long division: different answers when reordering terms
Solution 1:
Seeing as you tagged this sequences and series, I presume you know that you have to be careful when talking about adding up an infinite sequence of terms.
There is an infinite series hidden in your work when you write $$ \frac{1}{1-x}=1+x + x^2 +x^3 + \cdots, $$ but this series only converges when $|x|<1$. This sum is the Taylor series for $\frac{1}{1-x}$.
There is an infinite series hidden in your work when you write $$ \frac{1}{1-x} = -\frac{1}{x}- \frac{1}{x^2}-\frac{1}{x^3}- \cdots, $$ and this infinite series only converges when $|x|>1$ (or, equivalently, when $\left | \frac{1}{x} \right|<1$). This sum is the Laurent series for $\frac{1}{1-x}$.
So both expressions are correct (for the right values of $x$) but they are not both correct at the same time. One is valid for $|x|<1$ and the other for $|x|>1$.
Edited to add:
Just to clarify the situation a little further:
You are correct when you say that dividing by $-x+1$ should be the same as dividing by $1-x$. There is no problem with this as long as we stop after finitely many steps:
If we stop after three steps in the polynomial long division algorithm, we get $$ \frac{1}{1-x}=1+x +x^2 +\frac{x^3}{1-x}. $$ That is, we get an answer of $1+x + x^2$ with a remainder of $x^3$ that has not yet been divided by $1-x$.
Or if we do it the other way, after three steps, we get $$ \frac{1}{1-x}= - \frac{1}{x}-\frac{1}{x^2}-\frac{1}{x^3} +\frac{1}{x^3}\times \frac{1}{1-x}. $$ That is, we get an answer of $- \frac{1}{x}-\frac{1}{x^2}-\frac{1}{x^3}$ with a remainder of $\frac{1}{x^3}$ that has not yet been divided by $1-x$.
Let's assume that $x \neq 0$ and $x \neq 1$ so that everything is well-defined. Then $$ \frac{1}{1-x}=1+x +x^2 +\frac{x^3}{1-x} =- \frac{1}{x}-\frac{1}{x^2}-\frac{1}{x^3} +\frac{1}{x^3}\times \frac{1}{1-x}. $$ Both ways of doing it do give us the same answer.
So what's the problem? When we try continuing this to infinitely many terms, we need these infinite series to converge to the correct answer. It is not the order $-x+1$ versus $1-x$ that leads to different answers; it is the change from writing down a sum with finitely many terms to writing down a series with infinitely many terms that we have to be careful about.
Solution 2:
Note that the series $\;1 + x + x^2 +x^3 + x^4 + \cdots$ converges only for $|x|<1$. If this series is convergent thet you cannot write $\frac{1}{1-x}=-\frac{1}{x} - \frac{1}{x^2} - \frac{1}{x^3} - \frac{1}{x^4} - \cdots$ because $|\frac{1}{x}|>1$ and hence the last series diverges and therefore the equality does not hold. Also the other way around, if the last equality holds then the first one will not hold.