Course book's importance is very variable among different lecturers. I'll give you two marginal examples:
One lecturer in organic chemistry in my university keeps using a certain book, in which course topics, problems and even the words he uses comes from that book, don't go to the course but read the book and you will still learn everything he lectured on that time.
Another one, formally, has a book in course syllabus but never recommend it, when everyone begs him to suggest a coursebook, he says a couple of books but actually totally irrelevant. He has used many of his exam questions from a 3 specific and very old books for more than 20 years and actually everything is on the notes he has on his hand while lecturing, again a combination of quite old books, have them and you get 100/100 from exams.
You may guess, that it is really up to your lecturer about what coursebook you need to buy or borrow from library. But I will make another suggestion, again from one of the professor's back then: "If you want to learn the subject, try to ask questions and give answers by yourself, and then criticize your answers again. You will never have opportunity to go check the corrections of your answers in real life. "
I, too, sincerely suggest you this last idea, continuously criticizing and considering about what you learn will really help you comprehend the idea, unlike clinging to one or two books. Still, for the sake of grades, borrow course book two days before the exams and work on its questions/problems, as well.