Let there be 2x science and 5x art books
science books sold = 2x × 0.2 = 0.4x
science books unsold = 2x – 0.4x = 1.6x
art books sold = 5x × 0.2 = x
art books unsold = 5x – x = 4x
total books unsold = 1.6x + 4x = 5.6x
5.6x = 2240
x = 400
2x science = 800
and 5x art books = 2000