TeX source:
\matrix{-x+(-5)&=&2x+1\\+x&&+x\\&&\\-5&=&3x+1\\+(-1)&&+(-1)\\&&\\-6&=&3x\\\overline{3}&&\overline{3}\\&&\\-2&=&x}