Let the no. of books he bought = x , and cost of each book = Rs. y
xy = 1200 ------------------ eq 1
(x+10)(y - 20) = 1200
xy - 20x + 10y - 200 = 1200 (from eq - 1)
20x - 10y + 200 = 0
2x - y + 20 = 0
y = 2x + 20
Put this value in eq - 1
x(2x + 20) = 1200
2x2 + 20x - 1200 = 0
x2 + 10x - 600 = 0
x2 + 30x - 20x - 600 = 0
x(x + 30) - 20(x + 30) = 0
(x - 20)(x + 30) = 0
x = 20 or -30
So, No. of books he bought = 20 (as books cannot be -ve)