8x-2=5x+7
Subtract 5x from both sides
3x-2=7
Now you add 2 (Because of the negative)
3x=9
Now divide by 3 and you're done!
x=3