structural:expansion, stylistic:style_transfer
18th century: Euler and Stirling

The problem of extending the factorial to non-integer arguments was apparently first considered by Daniel Bernoulli and Christian Goldbach in the 1720s. In particular, in a letter from Bernoulli to Goldbach dated 6 October 1729 Bernoulli introduced the product representation x ! = lim n → ∞ (n + 1 + x 2) x − 1 ∏ k = 1 n k + 1 k + x {\displaystyle x!=\lim _{n\to \infty }\left(n+1+{\frac {x}{2}}\right)^{x-1}\prod _{k=1}^{n}{\frac {k+1}{k+x}}} which is well defined for real values of x other than the negative integers.

Leonhard Euler later gave two different definitions: the first was not his integral but an infinite product that is well defined for all complex numbers n other than the negative integers, n ! = ∏ k = 1 ∞ (1 + 1 k) n 1 + n k, {\displaystyle n!=\prod _{k=1}^{\infty }{\frac {\left(1+{\frac {1}{k}}\right)^{n}}{1+{\frac {n}{k}}}}\,,} of which he informed Goldbach in a letter dated 13 October 1729. He wrote to Goldbach again on 8 January 1730, to announce his discovery of the integral representation n ! = ∫ 0 1 (− log s) n d s, {\displaystyle n!=\int _{0}^{1}(-\log s)^{n}\,ds\,,} which is valid when the real part of the complex number n is strictly greater than −1 (i.e., ℜ (n) > − 1 {\displaystyle \Re (n)>-1}). By the change of variables t = −ln s, this becomes the familiar Euler integral. Euler published his results in the paper "De progressionibus transcendentibus seu quarum termini generales algebraice dari nequeunt" ("On transcendental progressions, that is, those whose general terms cannot be given algebraically"), submitted to the St. Petersburg Academy on 28 November 1729. Euler further discovered some of the gamma function's important functional properties, including the reflection formula.

James Stirling, a contemporary of Euler, also attempted to find a continuous expression for the factorial and came up with what is now known as Stirling's formula. Although Stirling's formula gives a good estimate of n !, also for non-integers, it does not provide the exact value. Extensions of his formula that correct the error were given by Stirling himself and by Jacques Philippe Marie Binet.