In 1747 Johann Sebastian Bach accepted the invitation of Frederick II to visit him in his court at Potsdam. The king, possibly as a provocation, gave the elderly composer a musical theme and asked him to produce, impromptu, a three-part fugue, which Bach ingeniously achieved. But when the king raised the stakes and requested a fugue for six voices, Bach demurred, promising to send it to him in due course. This became the 'Musical Offering', a complex, multi-layered work in sixteen movements, despatched to Frederick within two weeks. It runs counter to virtually all of Frederick's aesthetic preferences and is religious in tone; James Gaines reads it as a camouflaged rebuke to Frederick's beliefs and actions. Be that as it may, Frederick probably never heard it played and simply gave his copy away. On this poignant episode the author builds his book, as a meeting between two radically different figures of the Enlightenment period. The authoritative biography of Frederick by David Fraser allocates it, by contrast, only a very small footnote in his 700 pages, which adequately sums up the part it played in the Prussian king's life. But Mr Gaines (who appears not to know Fraser's work) feels that it can serve a symbolic purpose, highlighting the opposition between Bach's devout Lutheranism and Frederick's rationalist irreligiosity.

The idea is an interesting one, but it can hardly stretch to encompass a book–length discussion. So we get instead two quite separate biographies, coming together only in the last fifty pages. On the way, much is made of Frederick's upbringing, cruelly abused by his tyrannical father (who does not quit the scene until halfway through). The picture which emerges is of a leader fatally flawed from the start who, for all his achievements, led an empty, cynically driven existence, dying as he had lived, essentially alone. On the other hand Bach, despite his cantankerously quarrelsome nature, is seen as a genius superior even to Mozart (a rather futile comparison hardly worth attempting). Ultimately, the book comes down to a tension "between reason and faith, ratio and sensus, Frederick and Bach".

In this, the author's sympathies are clearly engaged with the latter, who would have found Frederick's world "something unremittingly solid and factual, La Mettrie's self–winding, spring–loaded machine". Such "objectification", indeed, leads to "concentration camps", whereas music stands on its own, evidence inexpressible in words that "the world is more than a ticking clock". Gaines rightly observes that the Enlightenment felt truth to be "observable and calculable" but seems to believe that there were no immutable laws (gravitation? refraction of light?). This would not appear to square with La Mettrie's mechanistic views — which, in any case, were vehemently rejected by such Enlightenment thinkers as Voltaire.

Gaines has, in effect, set up an unfair contest: the politician, condemned to "dirty hands" and imperfect enterprises, versus the sublime artist. The framework of this book does not hold. But what we do have is a sprightly narration, an attractively written account of two cultures that throws a fresh light on the large phenomenon we call the Enlightenment.

Evening in the Palace of Reason is available from Amazon (UK)