What are the criteria for an elementary function to be infinitely integrable in elementary functions? What features of elementary functions define a class of functions whose consecutive indefinite integration also gives an elementary function?
Is there a way to check whether a given elementary function has such property?
 A: Here's a potentially more practical criterion. It is based on the integration by parts identity
$$
  \int_0^x dy \int_0^y dz \, f(z)
  = x \int_0^x dz \, f(z) - \int_0^x dy \, y f(y)
$$
If you don't like $0$ as a lower integration bound, pick another point in the domain of $f(x)$ or just absorb it into an overall additive constant.
Iterating the above identity gives the following conclusion: an elementary function $f(x)$ is $n$-times integrable in terms of elementary functions iff each of $x^k f(x)$, for $k=0,\ldots,n-1$, is once integrable in terms of elementary functions.
A: Each of the elementary functions of Liouville and Ritt is infinitely differentiable within the elementary functions. That is because the elementary functions form a differential field that is closed under differentiation.
The following are two examples of elementary functions with an n-th derivative which is predictable.
Let $m$, $n$ $\in\mathbb{N}_{+}$.
Your elementary functions shall be infinitely often integrable within the elementary functions. That means, all $n$-th degree antiderivatives of this functions have to be infinitely often differentiable within the elementary functions.
a)
A first simple class of such elementary functions are the polynomials. The antiderivative of a polynomial is again a polynomial. Therefore each $n$-th degree antiderivative of a polynomial is a polynomial again.
b)
A second simple class of such functions, $f$, are the elementary functions having one $n$-th degree derivative that is $f$ again:
$$\frac{d^{n}f(x)}{dx^{n}}=f(x)$$
Because the $n$-th degree antiderivative is an elementary function, all $m$-th degree antiderivatives with $m<n$ are elementary functions again. These differential equations can be easily solved.
$ $
Also the Liouvillain functions form a differential field that is closed under differentiation. Therefore they are also infinitely differentiable in the Liouvillian functions. The elementary functions are a subfield of the Liouvillian functions.
Each function from a set which can be generated by successive integration from a self-differentiable function $x\mapsto ce^x$, $c$ a constant, is infinitely differentiable in this set.
