First phase of this problem requires you to determine how many mathematics and chemistry books are even on the shelf. To do so, you have the equations:
m + p + c = 20 (since 4/5 of the 25 spots are full of books)
m = 2p
p = 4 + c
From that, you can use Substitution to get everything down to one variable.
c = p - 4
m = 2p
p = p
Then (p - 4) + 2p + p = 20, so 4p = 24 and p = 6. That means that there are 12 math, 6 physics, and 2 chemistry books on the shelf.
With those numbers, you also know that there are 8 total hardcovers, 1 of which is chemistry. So if your goal is to get either a hardcover or a chemistry, there are 9 ways to "win" - either one of the 7 hardcovers that aren't chemistry or the two chemistry books. So out of the 20 total, 9 provide the desired outcome, making the answer E.
Note - a common trap answer here is A, as people forget that "2 chem + 8 hard" double counts the one book that is "both". Venn Diagram logic can be helpful to avoid that trap, or in cases like this with relatively small numbers it may be even more convenient to just write out the possibilities.