(y^2-y+2)/(y+2)

visit calc101.com and click on the long division button. See all the details.