You look at the highest degree term, so x squared goes into x squared one time, one times this whole thing is x squared minus 3x minus 40, and now you want to subtract this from that to get the remainder.