I stumbled upon following rational, where the right hand of equation is a simplification:
$$\frac{x^2 + 6x + 5}{x^2 - x - 2} = \frac{(x + 5)(x + 1)}{(x - 2)(x + 1)}$$
I can't understand how do you derive this simplification, what rules apply here?
Secondly, I want to search google for more (generic) information but I'm not even sure what should I search for?
EDIT:
Btw. this comes from this video link, but it doesn't explain my question.