# How would I evaluate $\int{x!}dx$?

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.)

• 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
– Alan
Jul 31, 2021 at 4:13
• 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$.
– Gary
Jul 31, 2021 at 6:14
• The asymptotics can be proved using L'Hôpital's rule and the asymptotics of the digamma function.
– Gary
Jul 31, 2021 at 6:22

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)