If I first publish an article, afterward I may publish a book containing materials from the article.
What's about the reverse: If I first publish a book does it make sense to publish its fragment as an article AFTERWARD?
"If I first publish a book does it make sense to publish its fragment as an article AFTERWARD?"
Sure, why not? You might write a book for one audience, and very usefully re-publish a fragment in the form of a journal article for another audience. I have done this with some stuff buried near the end of a long textbook book aimed at beginning grad students, which colleagues are unlikely to read, but which I thought (and the journal editor thought) was interesting enough for stand-alone publication in one of the journals. And I've done things the other way around too, taken something from a book aimed at a professional audience and reworked it as an article in a publication with a more general readership. [This was techie philosophy rather than straight maths, but I'd have thought the same principles would apply.]
So I guess you'd need to think about whether you would or would not be reaching significantly different audiences. (Of course, re-publication for the sake of padding out a CV is not a good idea!)
To add to the previous answers, it's very important to realize that unless you self-publish a book or article, it is almost always the case that the publisher will hold the copyright. That will be part of the contract you sign with the publisher. That means that you can't legally extract any part of the first work for publishing elsewhere, even though you wrote it. To avoid being sued for copyright infringement in a case like this you must obtain permission from the publisher (to whom you signed over the copyright).
In my experience, book publishers are generally happy to give you permission to extract part of your book for publishing elsewhere, as long as they don't see any negative impact on the sales of the original. It's not quite as straightforward for journal publishers: they can often be quite difficult when it comes to using your article as part of a compilation.
I am not an expert on publishing.
It of course makes good sense to publish articles and then later collect all the research and publish a book covering the material. Often articles covering the same topic can change in notation and so collecting the articles and editing them into a book form can make things a lot more readable.
Could you do the reverse? You might. But from what I understand you would probably need something new. I don't think that you will get something published as an article if the main results of the article are already contained in a book. However, you might be able to do so if you add extra research.
As a sidenote: You might be able to write a survey article. But from what I have seen, these tend to be trying to collect material from a lot of articles and try to make things easier to read. They can function as a "gentle" introduction to a topic so that a new researcher doesn't have to jump in the deep end starting with the original articles. But again, this doesn't (from what I understand) cover taking well presented material from a book and making an article out of it.