(Note: the answer below deals with US copyright law only.)
There are specific carve-out in the "fair use" law for "scholarship" and "research":
Notwithstanding the provisions of sections 106 and 106A, the fair use of a copyrighted work, including such use by reproduction in copies or phonorecords or by any other means specified by that section, for purposes such as criticism, comment, news reporting, teaching (including multiple copies for classroom use), scholarship, or research, is not an infringement of copyright. In determining whether the use made of a work in any particular case is a fair use the factors to be considered shall include—
- the purpose and character of the use, including whether such use is of a commercial nature or is for nonprofit educational purposes;
- the nature of the copyrighted work;
- the amount and substantiality of the portion used in relation to the copyrighted work as a whole; and
- the effect of the use upon the potential market for or value of the copyrighted work.
The US Copyright Office has some more information about how courts have interpreted fair use, as does Nolo. Going through these criteria one by one:
A work that is commercial is less likely to be fair use. A work that is "transformative", meaning that it serves a different purpose than the original, is more likely to be fair use.
Quoting from a factual work (such as an encyclopedia) is more likely to be fair use than quoting from a creative or imaginative work (such as a novel).
The less quoted, the better. If the quoted material is peripheral to the primary purpose of the quoted work, it is more likely to be fair use than if it's "the heart of the work". (As an example, The Nation was once found to have violated fair use because it quoted verbatim the section of Gerald Ford's memoirs that dealt with the Nixon pardon — even though the quoted section was less than 0.2% of the entire work.)
If your work will be directly competing with the original work in the market, it is less likely to be fair use.
Nolo also notes that
Quoting a short passage in a scholarly, scientific, or technical work for illustration or clarification of the author's observations would be deemed acceptable. An art historian would be able to use an image of a painting in an academic article that analyzes the painting.
Finally: even if you check every one of these boxes, the law is not 100% crystal clear, and there's still a chance that you'll get sued. While you might prevail in court, you'd still have to go through the hassle of defending your work; or alternately, you'd have to pull it from the market. For this reason, it may be worth your peace of mind to seek permission from the copyright holders anyhow, or to consult a legal professional.