Translation:I am reading a book in the library.
die Bibliothek became der Bibliothek because it is dative case with switchable two-away preposition 'in'. when the sentence with 'in' describing movement from one to another location, it will be accusative. and when the sentence describe something without shifting place, it will be dative.
in case anyone get confused with preposition just like I am : )