Not many histories of philosophy begin with Hamlet. Jonathan Rée, however, starts his new book in this unconventional way, largely because he is bored by what he calls the “well-worn plots and set-piece battles” of orthodox accounts of the subject. Philosophy, he believes, contains far more variety, invention, originality and oddity than we give it credit for. Showing this means stretching the definition of “philosopher” beyond the usual suspects (Hobbes, Locke, Hume, Bertrand Russell) to include such authors as Cervantes, Coleridge, Adam Smith, Tom Paine, Mary Wollstonecraft and Mary Ann Evans (George Eliot), along with a rich assortment of academic oddballs and minor eccentrics.

There is the 18th-century Irishman John Toland, for example, rumoured to be the illegitimate offspring of a priest and a prostitute, who started life as an Irish-speaking shepherd in Donegal and ended up as a renowned European intellectual admired by Leibniz and Voltaire. Born a Catholic, Toland became a militant Presbyterian in Glasgow, a free thinker in Holland (he might even have invented the term “free thinker”, along with “pantheism”) and an intellectual bruiser in the coffee houses of Oxford. He dabbled in occultism, mastered nine languages and roamed a London underworld of religious heretics, shady political operators and radical republicans. He may also have seduced the Electress Sophia of Brandenburg – not bad going for a Donegal shepherd. You won’t find his name in many philosophy textbooks, however, since unlike the modern Oxford philosopher Gilbert Ryle he showed not the slightest interest in the logical difference between the phrases “nothing chatters” and “nothing matters”. Ryle claimed to have used this distinction to talk a student out of suicide, an example of the tutorial system at its most effective.

Rather than whisking us from one philosophical peak to another, Witcraft wanders in the fertile valleys between

Witcraft complicates the familiar narrative of philosophy. Rather than whisking us from one prominent philosophical peak to another, it spends a lot of time wandering the fertile valleys between them. We learn about Descartes, but also about 17th-century scientists who still believed in magic. Even Falstaff is roped in to the story: there’s a Socratic touch to the way he imparts wisdom by playing the fool, and when he dies his body gradually freezes from the feet up, as Socrates’s did when he drank the hemlock.

The story Rée has to tell, from Shakespeare to the 20th century, is broadly chronological. It ends with a portrait of the spiritually tormented Ludwig Wittgenstein, who started off as one of the richest young men in Europe and ended up wearing trousers so tattered he had difficulty getting past a hotel doorman. Yet the book is far from a unified narrative. Borrowing from modernist literary techniques, Rée slices into British intellectual history at 50-year intervals from 1601 to 1951, while cheerfully admitting that these dates are pretty arbitrary. What we have, then, is less a lineage of Great Men than a series of cross-sections. We move through a set of landscapes rather than leap from one solitary figure to another. The book maps the way in which the different conceptual currents of a period intermingle, so that one of the finest literary critics ever to write in English, William Hazlitt, sits cheek-by-jowl with Edmund Burke, Jeremy Bentham and William Godwin. David Hume rubs shoulders with the 18th-century Ulsterman Francis Hutcheson, who championed the rights of women, children, servants, slaves and animals. He even put in a good word for aliens.

The history of philosophy usually tells us how one set of ideas gave birth to another. What it tends to overlook are the political forces and social upheavals that shaped them. Witcraft, by contrast, sees philosophy itself as a historical practice. For much of its career, it was never easy to distinguish from political conflict, religious strife and scientific controversy. For some 17th-century Puritans, philosophy was a satanic pursuit, an impious meddling with sacred truths. There was a battle between the church and the universities on the one hand, with their reverence for Aristotle and the schoolmen, and on the other the humanists, scientists, atheists and radicals. It is the stuffy old university of Wittenberg versus the humanistic Hamlet and his sceptical friend Horatio.

Rée is too subtle a thinker to reduce this quarrel to Reason versus Superstition, but AC Grayling has no such qualms. His The History of Philosophy (note the authoritative “The”) sees no dark side to the cult of Reason. And if reason can do little wrong, religion can do nothing right. Whereas Rée shows how religion and political radicalism can strike up fruitful alliances, the briskly rationalist Grayling refuses the title of philosophy to any view of the world that involves religious faith. One wonders how Plato and Bishop Berkeley managed to slip into these pages.

Grayling has a high regard for philosophy but does not seem to find it much fun, while Rée finds it a lot of fun but doesn’t rate it all that highly. Philosophers, he believes, have contributed little to the progress of knowledge. Instead, they go round in circles and are constantly at each other’s throats. Their ideas are then summarised in guides that force their readers to “rush through the canon like tourists on a tight schedule”. It isn’t a bad description of Grayling’s book, in which depth is sacrificed to breadth. Rousseau changed the sensibility of Europe, but gets only five pages. Karl Marx is awarded a couple more, but is accused of being a utopian thinker. In fact, Marx had hardly anything to say about the future, which is something of a handicap for a utopian visionary.

The difference between them is clear from their writing. Rée is enter­taining and stylish, Grayling is lucid but lifeless

In a mixture of arrogance and provincialism, Grayling seems to think that it is analytic philosophers such as he who get to decide who is a philosopher and who is not. A section of his book on modern European thinkers commits some elementary blunders, but this doesn’t matter much because these writers aren’t really philosophers anyway. When it comes to affairs of the mind, Grayling is determined to have as little truck as possible with fancypants foreigners, unless like Kant and Hegel they have been dead for a decent amount of time. There is a sharp contrast here with Rée, who charts the busy traffic of ideas between Britain, the US and Europe at large.

In Grayling’s guide, continental thinkers such as Walter Benjamin, Jacques Lacan and Simone Weil don’t merit enough attention to have their ideas mangled. Instead, they receive honorary mentions as “having made a difference to the wider landscapes of recent and contemporary thought”, language more suitable to a blurb writer than to the self-styled Master of the New College of the Humanities. The eminent Jewish thinker Emmanuel Levinas takes religion seriously, which clearly disqualifies him from being a philosopher; but Grayling, still in blurbish mode, is gracious enough to describe him as “an attractive figure whose ethical concerns exerted a life-transforming influence on some”. He could be talking about Bernie Sanders.

The book ends with a section on Indian, Chinese, Arabic-Persian and African philosophy, which might seem enough to refute the charge of provincialism. Yet one shouldn’t reach for the cigars too soon. Indian philosophy is summarised in around 15 pages, which is about the same amount of space devoted to John Locke, while African thought gets just short of seven pages, about half of what Grayling gives to Kant. All this lame gesture succeeds in doing is underlining how parochial the book actually is.

The difference between the two men is clear from the way they write. Rée’s book is stylish and entertaining, whereas Grayling’s prose is lucid but lifeless. The lucidity, however, has its limits. Grayling raps European thinkers over the knuckles for writing obscurely, but in a work aimed at the general reader he produces “[(p q) & q] therefore p”, which is not the kind of thing you hear in Tesco. Still, whether you understand such formulas is a handy way of sorting the Oxbridge cream from the continental dregs.

• Witcraft is published by Allen Lane (£30). The History of Philosophy is published by Viking (£26). To order go to guardianbookshop.com or call 0330 333 6846. Free UK p&p over £15, online orders only. Phone orders min p&p of £1.99.