The part about "books and materials not required to be purchased from the school" applies to the American Opportunity Credit only, so it doesn't apply to graduate students.
For more information, please see these FAQ:
What are Education Tax Credits?
What are qualified education expenses for the American Opportunity and Lifetime Learning credits?
... View more