Revising basic algebra, I came across the exercise: Simplify 5/(x + 1) + 2/(x+4).

No worries, I thought.

I wrote: 5(x+4)+2(x+1) / (x+1)(x+4) = 5x+20+2x+2 / x^{2}+5x+4 = 7x+22 / x^{2}+5x+ 4.

But the book answer was: 7x+22 / (x+1)(x+4)

which told me that I did right to multiply out the top part of the fraction and collect like terms, but I should have left the bottom half alone, even though

it can be correctly written as x^{2}+5x+4.

Why is this? Is it because we want to preserve first order terms as long as possible? Or is there some other basic principle I've failed to grasp?