How would I evaluate $\int{x!}dx$? Obviously elementary functions will not suffice. I looked up this problem on Google and have found no results. I've tried to logically think about this and haven't reached any conclusions. Obviously, the antiderivative of $x!$ implies that there must be a function whose derivative is $x!$. I've looked at the graph of $x!$ and it seems like you can cut the factorial at $x = 0$. The positive side resembles an exponential graph, while the negative side is more complicated. Is there any way to approach this?

(Also, this isn't for an assignment or anything, I was just interested in whether there is a way to take the antiderivative of a factorial. I'm also only in AP Calculus BC so I'm not an expert in this.)

  • 11
    $\begingroup$ The factorial is only defined on integers, so you can't integrate it as a real function. There is an extension of the factorial to the reals called the gamma function, which you may want to look into. en.wikipedia.org/wiki/Gamma_function $\endgroup$
    – Alan
    Jul 31, 2021 at 4:13
  • 3
    $\begingroup$ If you use $$ x! = \int_0^{ + \infty } {t^x e^{ - t} dt} , $$ you get $$ \int {x!dx} = \int_0^{ + \infty } {\frac{{t^x - 1}}{{\log t}}e^{ - t} dt} + C. $$ It seems that $$ \int_0^z {x!dx} \sim \frac{{z!}}{{\log z}} $$ as $z\to +\infty$. $\endgroup$
    – Gary
    Jul 31, 2021 at 6:14
  • $\begingroup$ The asymptotics can be proved using L'Hôpital's rule and the asymptotics of the digamma function. $\endgroup$
    – Gary
    Jul 31, 2021 at 6:22

1 Answer 1


If you want to consider $x!$ as a step function, this integrals boils down to

\begin{gather} \sum_{i=1}^n i! \end{gather}

which can be rewritten in terms of recurrence relations as $f(n) = f(n-1) + n!$ for which the solution is $f(n) = (-1)^{n + 1} Γ(n + 2)\ \ !(-n - 2)\, +\, !(-2)$ where $!x$ is the subfactorial function and $Γ$ is the gamma function (the extension of the factorial to the reals)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.