One important problem related with the origin of Calculus is finding "maxima and minima" of a function. For example, Euclid proved that among all rectangles of equal perimeter the square has the largest area. Fermat (born in 1601) has a different approach and was interested in the tangent of a curve and the relation of this tangent and the maximum (or minimun) of a function. Before Fermat, Kepler (1571-1630) was aware of this relation, though not in the sense of functions and derivatives. He wrote "Nova Stereometria doliorum vinariorum" (1615) a book about the volume of wine barrels and other bodies.
In this page I only try to illustrate Otto Toeplitz's explanation of this episode of the History of Calculus ("The Calculus: A genetic Approach" by Otto Toeplitz):
"Aside from his astronomical works, an instance of this is to be found in his so-called 'Doliometry', the 'barrel calculation'. When he, the imperial court astrologer at Linz, married the second time, he bought for the wedding wine from a barrel. To compute the bill, the wine merchant measured the barrel by inserting a foot rule into the taphole S until it reached the lid at D;
then he read off the length SD = d and set the price accordingly. This method outraged Kepler, who saw that a narrow, high barrel might have the same SD as a wide one and would indicate the same wine price, thought its volume would be ever so much smaller.
Giving further thought to this method of using d to determine the volume, Kepler approximated the barrel somewhat roughly by a cylinder, with v the radius of the base and h the height. Then
Hence, for the volume
Then he asked: If d is fixed, what value of h gives the largest volume V? V is a polynomial in h; hence the derivative (though of course, Kepler did not use derivatives)
For V to be a maximum, V' must equal zero; hence
That defined a barrel of definite proportions. Kepler noticed that in his Rhenish homeland barrels were narrowed and higher than in Austria, where their shape was peculiarly close to that having a maximum volumen for a fixed d -so close, indeed, that Kepler could not believe this to be a accidental. So he imagined that centuries ago somebody had calculated barrel shapes, as he himself was doing, and had taught the Austrians tho construct their barrels in this particular fashion- a very practical one, indeed. Kepler showed that if a barrel did not satisfy the exact mathematical specification
but deviated somewhat from it, this would have but little effect on the volume, because near its maximum a function changes only slowly.
Thus, while the Austrian method of price determination, if applied to Rhenish barrels, would be a clear fraud, it was quite legitimate for Austrian barrels. The Austrian shape had the advantage of permitting such a quick and simple method. So Kepler relaxed in this instance. Working out finer approximations of various barrel shapes, he consulted Archimedes and discovered that his own method of indivisibles had enabled him to obtain results in a far simpler and more general way than Archimedes, who had been struggling with cumbersome and difficult proofs. What he did not suspect was that Archimedes, too, had found his results by the same method of indivisibles (for the Method was lost until 1906!). Kepler devoted to these problems a whole book containing computations of many volumes."
You can see a page from Nova Stereometria doliorum vinaniorum, german version, from MathDL.
Otto Toeplitz - The Calculus: A Genetic Approach (pag. 82-83) - The University Of Chicago Press