This is the 103rd most frequent Japanese word.
しまう
To finish, put away, or do something unintentionally.
Here, 'しまう' implies regret or an unintended action, emphasizing the unfortunate forgetfulness about the homework.
宿題を忘れてしまった。
I ended up forgetting my homework.
In this sentence, 'しまう' expresses an accidental or unintended outcome, specifically the breaking of the phone.
スマホを壊してしまった。
I accidentally broke my smartphone.
'しまう' here denotes the act of completing an action, suggesting a positive outcome of finishing the book.