(a^2 - a - 2)/(a^2 - 7a + 10) - (a^2 - 2a -3)/(a^2 + 5a + 4)
Factor first.
(a - 2)(a + 1) (a - 3)(a + 1)
----------------- - ----------------
(a - 2)(a - 5) (a + 4)(a + 1)
Cancel the common factors in each term. The (a-2)'s in the first term and the (a + 1)'s in the second term.
(a + 1) (a - 3)
--------- - --------
(a - 5) (a + 4)
Now get the LCD of the two terms: The product of (a - 5)(a + 4). Leave in this form. Multiply the first term by (a + 4) and the second term by (a - 5).
(a + 1)(a + 4) - [ (a - 3)(a - 5) ] FOIL the binomials
------------------------------------
(a - 5)(a + 4)
a^2 + 5a + 4 - [a^2 - 8a + 15] Distribute the negative through the [ ]
------------------------------------
(a - 5)(a + 4)
a^2 + 5a + 4 - a^2 + 8a - 15 Combine like terms
----------------------------------
(a - 5)(a + 4)
13a - 11
--------------------
(a - 5)(a + 4)