Ruby:
Another way of doing the problem in at least two steps.
2(x6)=18
Step 1: Expand the bracket on the left. 2x  12 =  18
Step 2: Add 12 to both sides. 2x  12 + 12 =  18 + 12. that is, 2x = 6
Step 3: Divide both sides by 2: (2/2)x = (6/2), that is, x = 3. Done.
If you have any questions, please post a comment.
Dattaprabhakar (Dr. G.)
Irvine, CA
8/31/2014

Dattaprabhakar G.