Explanation
Let x = number of books on the small shelf, and x 8 = number of books on the large shelf. Then, 4x = number of books on 4 small shelves, and 3(x+8) = number of books on 3 large shelves.
4x + 3(x + 8) = 297
4x + 3x + 24 = 297
7x + 24 = 297
7x = 297 − 24
\(7 x=273 \div 7=39\)