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?
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?
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.
My recent papers
Chen, Shaoshi, Stability Problems in Symbolic Integration, MR4488863.
Chen, Shaoshi; Feng, Ruyong; Guo, Zewang; Lu, Wei, Stability problems on D-finite functions, ZBL07760759 MR4618424.
may partially answer this question. For a self-map $f$ from $A$ to $A$, an element $a$ in $A$ is said to be stable if there exists a sequence $a_i$ in $A$ such that $a_0=a$ and $a_i = f(a_{i+1})$ for all $i\geq 0$. Now taking $A$ to be the field of elementary functions and $f$ the derivation on $A$. This paper shows that $\exp(f(x))$ with $f$ being a rational-function in $\mathbb{C}(x)$ is stable if and only if $f = ax + b$ with $a, b$ being constants in $\mathbb{C}$. Similarly, $\log(f(x))$ with $f$ being a rational-function in $\mathbb{C}(x)$ is stable if and only if $f$ is a Laurent polynomial in $\mathbb{C}[x, 1/x]$. In general, it is a challenging problem to characterize all possible stable elementary functions, especially the case of algebraic functions.
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.