Comparative analysis of history of mathematics I am a bit scared about writing this question because I am unsure if it is appropriate. However, here it is.
Is there anything written about the history of mathematics from a comparative or (post)structuralist point of view? In particular, are there studies of the interplay between mathematics and philosophy?
For example, something that immediately comes to mind is:

*

*the influence of Leibniz's/Newton's idealistic philosophy on early calculus;

*the influence of materialism on German/French analytical schools of the 19th century;

*the influence of (post)structuralism on Grothendieck's philosophy of geometry.

There should be, of course, many more such parallels, but I am expert enough neither in mathematics nor philosophy to formulate them.
 A: Michel Serres, a French philosopher who passed away four years ago, wrote a book on the Origins of Geometry. He tried to understand when and how geometry arose in the ancient times.
His style is peculiar and was criticized by Sokal and Bricmont in their book Fashionable nonsense.
A: Jeremy Gray has written a few things that might fit into this category, including the following.

*

*Plato's Ghost: The Modernist Transformation of Mathematics. The book's thesis is that "1890 to 1930 saw mathematics go through a modernist transformation. Here, modernism is defined as an autonomous body of ideas, having little or no outward reference, placing considerable emphasis on formal aspects of the work and maintaining a complicated—indeed, anxious—rather than a naïve relationship with the day-to-day world, which is the de facto view of a coherent group of people, such as a professional or discipline-based group that has a high sense of the seriousness and value of what it is trying to achieve."

*Worlds Out of Nothing: A Course in the History of Geometry in the 19th Century. More strictly historical, but there is plenty of discussion of the influence of philosophical ideas on the development of geometry (search for occurrences of 'Kant', for example).

More generally there has of course been a huge interplay between philosophy and mathematics, particularly within the foundational debates of the late 19th and early 20th century, stimulated by (and stimulating) technical developments in mathematical logic. But that literature is a little too large to survey in a Mathoverflow post. One starting point is the papers in Jean van Heijenoort's classic collection From Frege to Gödel: A Source Book in Mathematical Logic.
Two classic books on how the development of set theory was influenced by philosophy (and which haven't been mentioned in other answers) are Cantorian Set Theory and Limitation of Size by Michael Hallett, and Zermelo's Axiom of Choice: Its Origins, Development, and Influence by Gregory Moore.
A: I am not sure but you should look at the works of Joan L. Richards who specializes in history of mathematics.
A: Maarten Bullynck has studied relations between Lambert's philosophical ideas and his mathematics. See http://www.kuttaka.org/~JHL/About.html for a start.
A: I know one book which does, it's called "Infinitesimal: How a Dangerous Mathematical Theory Shaped the Modern World" which talks about how the infinitesimal was rejected to protect the political standing of the church.
There were some members from Society of Jesus who were like some sort of Social engineers in the 16th century and they were in charge of what ideas would be allowed to continue to run into society. They tried to paint the idea of infinitesimal as  total nonsense.

For, strange as it might seem to us, the condemnation of indivisibles in 1632 was not an isolated incident in the chronicles of the Jesuit Revisors, but merely a single volley in an ongoing campaign. In fact, the records of the meetings of the Revisors, which are kept to this day in the Society’s archives in the Vatican, reveal that the structure of the continuum was one of the main and most persistent of this body’s concerns. The matter had first come up in 1606, just a few years after General Acquaviva created the office, when an early generation of Revisors was asked to weigh in on the question of whether “the continuum is composed of a finite number of indivisibles.” The same question, with slight variations, was proposed again two years later, and then again in 1613 and 1615. Each and every time, the Revisors rejected the doctrine unequivocally, declaring it to be “false and erroneous in philosophy … which all agree must not be taught.”


(Chap-4)Tacquet’s claim to mathematical fame rested chiefly on his 1651 book Cylindricorum et annularium libri IV (“Four Books on Cylinders and Rings”), in which he showed a complete mastery of the full mathematical arsenal available in his day. He calculated the areas and volumes of geometrical figures using both classical approaches and the new methods developed by his contemporaries and immediate predecessors. But when it came to indivisibles, the usually mild-mannered Jesuit turned blunt:
I cannot consider the method of proof by indivisibles as either legitimate or geometrical … many geometers agree that a line is generated by the movement of a point, a surface by a moving line, a solid by a surface. But it is one thing to say that a quantity is generated from the movement of an indivisible, a very different thing to say that it is composed of indivisibles. The truth of the first is altogether established; the other makes war upon geometry to such an extent, that if it is not to destroy it, it must itself be destroyed.
Destroy or be destroyed—such were the stakes when it came to infinitesimals, according to Tacquet. Strong words indeed, but to the Fleming’s contemporaries, they were not particularly surprising. Tacquet was, after all, a Jesuit, and the Jesuits were then engaged in a sustained and uncompromising campaign to accomplish precisely what Tacquet was advocating: to eliminate the doctrine that the continuum is composed of indivisibles from the face of the earth. Should indivisibles prevail, they feared, the casualty would be not just mathematics, but the ideal that animated the entire Jesuit enterprise.

Tl;dr: Calculus... Christianity.... and Society of Jesus?!?!
Here is another MSE post discussing the same
A: Moritz Epple’s book on the history of knot theory certainly fits the mold. It is in German, however. There are, of course, a great many individual articles as well.
A: I'm not aware of anything exactly like what you have in mind, but here are a few things which might be close.  They all take aim at the widespread belief that the intellectual development of mathematics takes place independently of any extra-mathematical philosophical beliefs.  Perhaps not surprisingly, the examples below have to do with infinity in one way or another.
You mentioned Leibniz.  Leibniz on Mathematics and the Actually Infinite Division of Matter by Samuel Levy argues that Leibniz developed his novel ideas in mathematics and metaphysics in concert.
Georg Cantor:
His Mathematics and Philosophy of the Infinite by Joseph Dauben describes the close relationship between Cantor's philosophical and mathematical beliefs.
The book Naming Infinity by Loren Graham and Jean-Michel Kantor make an intriguing argument that the pioneers of descriptive set theory were strongly influenced by their belief in name-worshipping.
A: An excellent and very recent comparative analysis (which addresses your first two bullet points) on the development of infinitesimal calculus has been done by Jacques Bair, Alexandre Borovik, Vladimir Kanovei, Mikhail G. Katz, Semen Kutateladze, Sam Sanders, David Sherry, and Monica Ugaglia (I do not write "et al." here as this is of course effectively always inappropriate in mathematics). This can be found on the arXiv here: Historical infinitesimalists and modern historiography of infinitesimals (arXiv:2210.14504). A follow-up by the same authors, responding to some criticism, can be found here: Is pluralism in the history of mathematics possible? (arXiv:2212.12422). There seems no shortage of lively debate in this area!
For your question: "In particular, are there studies of the interplay between mathematics and philosophy?" this seems like a very, very broad question (and a related is question is of course Has philosophy every clarified mathematics?). You might be interested in reading Wittgenstein's lectures on the foundations on mathematics, which include discussions (often lively) between Ludwig Wittgenstein and Alan Turing (who was in the audience).
