Let us assume the answer is only available in his book for simplification.
If the author would not answer here, the answer would not be available on the internet. It is much harder to find informaton in a paper based book wihthout knowing which, and that it exists at all.
So, for most practical purposes, that means it is "just not available".
Now, in answering the question, he makes part of the book available for free, and perfectly easy find.
But while the part he makes availab is only a small fraction of the content,
he selects the fraction that provides 100% of the actual problem solving value to the asking user.
So, one could argue that, for the asker, the monetary value of the answer is at least as large as the full price of the book.
That is because the only way to solve the problem without the anwer has the cost of the sum of the cost of the following parts:
- decide to risk literature research effort, not knowing a suitable book exists
- conduct literature research, including recognizing a book can solve the problem without access to the text
- aquire book at full book price or from library
- recognize section of book or repeat from top
- adapt solution from book to actual problem
I expect the sum of costs (including backtracking loops) is greater than the full book price.
When, realistically, but contrary to the simplifying assumption, his answer is not the only possible, but merely the best answer - or even just one of multiple good answers, it would change the details, but I feel the argument would still apply.
When looking from this viewpoint, it is perfectly acceptable when the author of both the answer and the book adds a reference to his book.
The form of the reference could describe it from this viewpoint, like below:
(This answer is an excerpt from my book "Answering Interesting Questions Every Day", section 3.1.4 "Answering: example 2345" adapted to your problem (ISBN99999999))