To divide a fraction by another fraction you changed the division into a multiplication by the reciprocal. (IOW you changed division into multiplication and then flipped the second number upside down.)
When you multiply fractions, it is a good idea to cancel common factors, even from one fraction's numerator to the other's denominator, before multiplying the fractions. for example:
This is much easier than multiplying first and then trying to reduce.
The same rules still apply when fractions are made up of numerators and denominators that are polynomials! So we will take divided by and turn it into a multiplication:
Now we will see if there are factors we can cancel before we multiply. (Factoring numbers is much easier than factoring polynomials but the idea is the same.) Both denominators and the first numerator factors. (For the second numerator we can factor out a 1 if it will help.):
As you can see, we do have some factors that will cancel. But it is to our advantage to cancel as much as possible. So with that in mind let's look at the factors (1-x) and (x-1). These are not the same. But... they are negatives of each other! So if we factor out a -1 from one of them, then we will have an extra pair of factors to cancel. (I will also to the problem as if we did not notice this and know how to take advantage of it.)
Now let's cancel the common factors:
leaving
which simplifies to:
If we did not recognize how to take advantage of factoring out -1:
leaving:
Multiplying we get:
If we still cannot recognize that (1-x) and (x-1) are negatives of each other, then there is no more simplifying that we can do. And we end up with this unreduced fraction instead of the reduced fraction .