Cuius rei demonstrationem mirabilem sane detexi hanc marginis exiguitas non caperet.
I have discovered a truly remarkable proof of this theorem which this margin is too small to contain.
Note written on the margins of his copy of Claude-Gaspar Bachet's translation of the famous Arithmetica of Diophantus, this was taken as an indication of what became known as Fermat's last theorem, a correct proof for which would be found only 357 years later; as quoted in Number Theory in Science and Communication (1997) by Manfred Robert Schroeder
Et cette proposition est généralement vraie en toutes progressions et en tous nombres premiers; de quoi je vous envoierois la démonstration, si je n'appréhendois d'être trop long.
And this proposition is generally true for all progressions and for all prime numbers; the proof of which I would send to you, if I were not afraid to be too long.
Fermat (in a letter dated October 18, 1640 to his friend and confidant Frénicle de Bessy) commenting on his statement that p divides ap−1 − 1 whenever p is prime and a is coprime to p (this is what is now known as Fermat's little theorem).
There is scarcely any one who states purely arithmetical questions, scarcely any who understands them. Is this not because arithmetic has been treated up to this time geometrically rather than arithmetically? This certainly is indicated by many works ancient and modern. Diophantus himself also indicates this. But he has freed himself from geometry a little more than others have, in that he limits his analysis to rational numbers only; nevertheless the Zetcica of Vieta, in which the methods of Diophantus are extended to continuous magnitude and therefore to geometry, witness the insufficient separation of arithmetic from geometry. Now arithmetic has a special domain of its own, the theory of numbers. This was touched upon but only to a slight degree by Euclid in his Elements, and by those who followed him it has not been sufficiently extended, unless perchance it lies hid in those books of Diophantus which the ravages of time have destroyed. Arithmeticians have now to develop or restore it. To these, that I may lead the way, I propose this theorem to be proved or problem to be solved. If they succeed in discovering the proof or solution, they will acknowledge that questions of this kind are not inferior to the more celebrated ones from geometry either for depth or difficulty or method of proof: Given any number which is not a square, there also exists an infinite number of squares such that when multiplied into the given number and unity is added to the product, the result is a square.
Fermat's Last Theorem is to the effect that no integral values of x, y, z can be found to satisfy the equation xn+yn=zn if n is an integer greater than 2. ...It is possible that Fermat made some... erroneous supposition, though it is perhaps more probable that he discovered a rigorous demonstration. At any rate he asserts definitely that he had a valid proof—demonstratio mirabilis sane—and the fact that no theorem on the subject which he stated he had proved has been subsequently shown to be false must weigh strongly in his favour; the more so because in making the one incorrect statement in his writings (namely, that about binary powers) he added that he could not obtain a satisfactory demonstration of it. … it took more than a century before some of the simpler results which Fermat had enunciated were proved, and thus it is not surprising that a proof of the theorem which he succeeded in establishing only towards the close of his life should involve great difficulties. ...I venture however to add my private suspicion that continued fractions played a not unimportant part in his researches, and as strengthening this conjecture I may note that some of his more recondite results—such as the theorem that a prime of the form 4n+1 is expressible as the sum of two squares— may be established with comparative ease by properties of such fractions.
Descartes' method of finding tangents and normals... was not a happy inspiration. It was quickly superseded by that of Fermat as amplified by Newton. Fermat's method amounts to obtaining a tangent as the limiting position of a secant, precisely as is done in the calculus today. ...Fermat's method of tangents is the basis of the claim that he anticipated Newton in the invention of the differential calculus.
Fermat had recourse to the principle of the economy of nature.Heron and Olympiodorus had pointed out in antiquity that, in reflection, light followed the shortest possible path, thus accounting for the equality of angles. During the medieval period Alhazen and Grosseteste had suggested that in refraction some such principle was also operating, but they could not discover the law. Fermat, however, not only knew (through Descartes) the law of refraction, but he also invented a procedure—equivalent to the differential calculus—for maximizing and minimizing a function of a single variable. ...Fermat applied his method ...and discovered, to his delight, that the result led to precisely the law which Descartes had enunciated. But although the law is the same, it will be noted that the hypothesis contradicts that of Descartes. Fermat assumed that the speed of light in water to be less than that in air; Descartes' explanation implied the opposite.
Since Fermat introduced the conception of infinitely small differences between consecutive values of a function and arrived at the principle for finding the maxima and minima, it was maintained by Lagrange, Laplace, and Fourier, that Fermat may be regarded as the first inventor of the differential calculus. This point is not well taken, as will be seen from the words of Poisson, himself a Frenchman, who rightly says that the differential calculus "consists in a system of rules proper for finding the differentials of all functions, rather than in the use which may be made of these infinitely small variations in the solution of one or two isolated problems."
J.M. Child... has made a searching study of Barrow and has arrived at startling conclusions on the historical question relating to the first invention of the calculus. He places his conclusions in italics in the first sentence as follows Isaac Barrow was the first inventor of the Infinitesimal Calculus... Before entering upon an examination of the evidence brought forth by Child it may be of interest to review a similar claim set up for another man as inventor of the calculus... Fermat was declared to be the first inventor of the calculus by Lagrange, Laplace, and apparently also by P. [Paul] Tannery, than whom no more distinguished mathematical triumvirate can easily be found. ...Dinostratus and Barrow were clever men, but it seems to us that they did not create what by common agreement of mathematicians has been designated by the term differential and integral calculus. Two processes yielding equivalent results are not necessarily the same. It appears to us that what can be said of Barrow is that he worked out a set of geometric theorems suggesting to us constructions by which we can find lines, areas and volumes whose magnitudes are ordinarily found by the analytical processes of the calculus. But to say that Barrow invented a differential and integral calculus is to do violence to the habit of mathematical thought and expression of over two centuries. The invention rightly belongs to Newton and Leibniz.
Florian Cajori, "Who was the First Inventor of Calculus" The American Mathematical Monthly (1919) Vol.26
Fermat applied his method of tangents to many difficult problems. The method has the form of the now-standard method of differential calculus, though it begs entirely the difficult theory of limits.
Morris Kline, Mathematical Thought from Ancient to Modern Times (1972)
Fermat knew that under reflection light takes the path requiring least time and, convinced that nature does indeed act simply and economically, affirmed in letters of 1657 and 1662 his Principle of Least Time, which states that light always takes the path requiring least time. He had doubted the correctness of the law of refraction of light but when he found in 1661 that he could deduce it from his Principle, he not only resolved his doubts about the law but felt all the more certain that his Principle was correct. ...Huygens, who had at first objected to Fermat's Principle, showed that it does hold for the propagation of light in media with variable indices of refraction. Even Newton's first law of motion, which states that the straight line or shortest distance is the natural motion of a body, showed nature's desire to economize. These examples suggested that there might be a more general principle. The search for such a principle was undertaken by Maupertuis.
Morris Kline, Mathematical Thought from Ancient to Modern Times (1972)
One may regard Fermat as the first inventor of the new calculus. In his method De maximis et minimis he equates the quantity of which one seeks the maximum or the minimum to the expression of the same quantity in which the unknown is increased by the indeterminate quantity. In this equation he causes the radicals and fractions, if any such there be, to disappear and after having crossed out the terms common to the two numbers, he divides all others by the indeterminate quantity which occurs in them as a factor; then he takes this quantity zero and he has an equation which serves to determine the unknown sought. ...It is easy to see at first glance that the rule of the differential calculus which consists in equating to zero the differential of the expression of which one seeks a maximum or a minimum, obtained by letting the unknown of that expression vary, gives the same result, because it is the same fundamentally and the terms one neglects as infinitely small in the differential calculus are those which are suppressed as zeroes in the procedure of Fermat. His method of tangents depends on the same principle. In the equation involving the abscissa and ordinate which he calls the specific property of the curve, he augments or diminishes the abscissa by an indeterminate quantity and he regards the new ordinate as belonging both to the curve and to the tangent; this furnishes him with an equation which he treats as that for a case of a maximum or a minimum. ...Here again one sees the analogy of the method of Fermat with that of the differential calculus; for, the indeterminate quantity by which one augments the abscissa x corresponds to its differential dx, and the quantity ye/t, which is the corresponding augmentation [Footnote: Fermat lets e be the increment of x, and t the subtangent for the point x,y on the curve.] of y, corresponds to the differential dy. It is also remarkable that in the paper which contains the discovery of the differential calculus, printed in the Leipsic Acts of the month of October, 1684, under the title Nova methodus pro maximis et minimis etc., Leibnitz calls dy a line which is to the arbitrary increment dx as the ordinate y is to the subtangent; this brings his analysis and that of Fermat nearer together. One sees therefore that the latter has opened the quarry by an idea that is very original, but somewhat obscure, which consists in introducing in the equation an indeterminate which should be zero by the nature of the question, but which is not made to vanish until after the entire equation has been divided by that same quantity. This idea has become the germ of new calculi which have caused geometry and mechanics to make such progress, but one may say that it has brought also the obscurity of the principles of these calculi. And now that one has a quite clear idea of these principles, one sees that the indeterminate quantity which Fermat added to the unknown simply serves to form the derived function which must be zero in the case of a maximum or minimum, and which serves in general to determine the position of tangents of curves. But the geometers contemporary with Fermat did not seize the spirit of this new kind of calculus; they did not regard it but a special artifice, applicable simply to certain cases and subject to many difficulties, ...moreover, this invention which appeared a little before the Géométrie of Descartes remained sterile during nearly forty years. ...Finally Barrow contrived to substitute for the quantities which were supposed to be zero according to Fermat quantities that were real but infinitely small, and he published in 1674 his method of tangents, which is nothing but a construction of the method of Fermat by means of the infinitely small triangle, formed by the increments of the abscissa e, the ordinate ey/t, and of the infinitely small arc of the curve regarded as a polygon. This contributed to the creation of the system of infinitesimals and of the differential calculus.
J. Lagrange, "Lecons sur le calcul des fonctions," leçon dix-huitiéme, (Euvres de Lagrange, publiées par J.A. Serret, Tome X, p. 294 as translated by Florian Cajori, "Who was the First Inventor of Calculus" The American Mathematical Monthly (1919) Vol.26
This great geometrician expresses by the character E the increment of the abscissa; and considering only the first power of this increment, he determines exactly as we do by differential calculus the subtangents of the curves, their points of inflection, the maxima and minima of their ordinates, and in general those of rational functions. We see likewise by his beautiful solution of the problem of the refraction of light inserted in the Collection of the Letters of Descartes that he knows how to extend his methods to irrational functions in freeing them from irrationalities by the elevation of the roots to powers. Fermat should be regarded, then, as the true discoverer of Differential Calculus.Newton has since rendered this calculus more analytical in his Method of Fluxions, and simplified and generalized the processes by his beautiful theorem of the binomial. Finally, about the same time Leibnitz has enriched differential calculus by a notation which, by indicating the passage from the finite to the infinitely small, adds to the advantage of expressing the general results of calculus, that of giving the first approximate values of the differences and of the sums of the quantities; this notation is adapted of itself to the calculus of partial differentials.
I had a hint of this method [of fluxions] from Fermat's way of drawing tangents, and by applying it to abstract equations, directly and invertedly, I made it general.
Isaac Newton as quoted by Louis Trenchard More, Isaac Newton, A biography (1934) p. 185, note 35
Fermat is... honored with the invention of the differential calculus on account of his method of maxima and minima and of tangents, which, of the prior processes, is in reality the nearest to the algorithm of Leibniz; one could with equal justice, attribute to him the invention of the integral calculus; his treatise De æquationum localium transmutatione, etc., gives indeed the method of integration by parts as well as rules of integration, except the general powers of variables, their sines and powers thereof. However, it must be remarked that one does not find in his writings a single word on the main point, the relation between the two branches of the infinitesimal calculus.
P. Tannery, "Fermat" in La Grande Encyclopédie (Berthelot) as quoted by Cajori, op. cit.