the numerators of the "problem" functions are the same in line 2 as they are in line 3. thus the denominators must be the same. what you should have done in moving from line 2 to line 3, is cancel the (p - 6)'s, the (p + 4)'s and the (p - 3)'s from the numerator and denominator