Bookshelf

A bookshelf is $36$ inches long and contains $n$ books each $w$ inches thick. If each book were half an inch thinner, the shelf would hold six more of the same book. What is $n/w$?
Source: NCTM Mathematics Teacher, February 2006

SOLUTION
$nw=36\qquad\qquad\qquad\qquad (1)$
$(n+6)(w-1/2)=36\qquad (2)$
Substitute the value of $w$ from Eq.$(1)$ into Eq.$(2)$
$(n+6)(36/n-1/2)=36$
$36-n/2+216/n-3=36$
Simplify
$n^2+6n-432=0$
$(n+24)(n-18)=0$
$n=-24$ (extraneous solution) or $n=18$
Substitute the value of $n$ into Eq.$(1)$
$18w=36$
$w=2$
$n/w=18/2=9$

Answer: $9$