Could anyone help me with this problem:

I have got a wrong result

But I find that if I divided the fraction's upper part and lower part by -x instead of x at the same time, I can get the correct result which is 1/4.

But could anyone explain that, why I can't divided the fraction's upper part and lower part by x at the same time?