I can't remember a phrasal verb or an idiom that describes something that came too late, i.e. i bought this book to solve this mathematical problem, however as it only came a week later it was xxxxxx.
As requested, a good starting point is a page that lists idioms containing the word late, see here.
One of them is “A day late and a dollar short”.
Personally, I like “That ship has sailed”, which you will not find in the link above, but is mentioned here.
As @FumbleFingers notes, the use of a phrase “A day late and a dollar short” would be wrong if the book actually contains a solution to the mentioned mathematical problem (it would be appropriate if it came late and it did not have anything in it to help solve the problem).
For some reason horse analogies seem popular for this type of thing. Doing something too late to be effective is often referred to as "shutting the door after the horse has bolted", while doing things in the wrong order is "putting the cart before the horse".
As FumbleFingers says, there are many other candidates; it's worth noting that the (very useful) link that Unreason posted only contains phrases that actually contain the word "late".
My preference for your situation would be "too little, too late" - but strictly speaking that, and "a day late and a dollar short", imply that the book was not only late but didn't provide you with the solution for your mathematical problem either.