
Remember if we are dividing variables with exponent, we are subtracting the exponent of the denominator from the exponent of the numerator ( numerator - denominator) if and only if they have the same base (in this case, it is x) otherwise we are not allowed to do so.
