To see what is going on, work backwards from the answer.
Long division (or synthetic division) of
(-2s^3-8s^2+4s+40)/(s^3+4s^2+3s)
Works out to be -2 with a remainder of (10 s +40) /(s^3 +4 s^2 + 3s)
The -2 cancels with the 2 leaving (10 s +40) /(s^3 +4 s^2 + 3s)
I don't know why anyone would look at things this way, but it does work out.