You may want to review factoring polynomials first.

Rational functions are to polynomials as fractions are to
integers. That is, if you divide two polynomials, you get a
rational function. Of course, that means that any polynomial is a
rational function, just like any integer is a rational number. But
there are many others, like (2*x*^{2} + *x*) /
(2*x*^{3} − *x*^{2} −
2*x*), for example.

As with fractions, just because two rational
functions *look* different, that doesn't mean
they *are* different. You need to try to reduce them first.
You do that by looking for factors that go into both the numerator
and the denominator. But now they won't necessarily be whole
numbers; the factors could be polynomials too. For example, in the
case above, *x* goes into both the numerator and the
denominator, so we can cancel it and get (2*x* + 1) /
(2*x*^{2} − *x* − 2). Now it's
possible that we could reduce it more, except that neither the
numerator nor the denominator factors. (If the denominator
factored, then we'd have to see if one of the factors was
2*x* + 1, and cancel it if it were.) In fact, we're done.