I have a problem that i don't understand what the solutions manual did. I am learning as much calculus 2 over the summer as i can.

Here is the part where i am confused..

Then,

Finally

(using long division)

I am not sure how they got the answer by the steps. The first step is the most confusing. the second step i can see how they got it. Third step is confusing on how they got

.

The rest of it i understand.

Can anyone explain the first step and the third one?