The author has done nothing special.

Since you have an expression with just factors in it, you CAN definetely "just cancel out" the x.

The author has simply broken out the GCF (greatest common factor) from both the

So

Now the gets cancelled out, and we´re left with just