Sandy began with a number of books that we don't know. Since that number is unknown to us, we use a variable to represent it. Let x = the number of books Sandy began with.
Sandy sold half of her comic books.
She sold x/2 books, and she kept x/2 books.
She kept x/2 books. Then she bought 9 books.
Now she has x/2 + 9 books. We are told she now has 12 books.
That means x/2 + 9 must equal 12. That gives us the equation.

Now we solve the equation. We subtract 9 from both sides.

Multiply both sides by 2.

Since we let x equal the number of books she began with, now we know she began with 6 books.
Answer: She began with 6 books.