Can someone explain this to me?

The sum of both angles will be 180° because we know that if two angles are formed on a straight line their sum will be 180° forming a linear pair.
[tex]\rule{300pt}{3pt}[/tex]
[tex]5x + 2 + 12x - 4 = 180[/tex]
[tex]17x - 2 = 180[/tex]
[tex]17x = 180 + 2[/tex]
[tex]17x = 182[/tex]
[tex]x = 10 \: \sf \: (rounded \: off)[/tex]