Are some indefinite integrals impossible to compute or just don't exist?

The indefinite integral of a continuous function always exists. It might not exist in "closed form", i.e. it might not be possible to write it as a finite expression using "well-known" functions. The concept of "closed form" is somewhat vague, since there's no definite list of which functions are "well-known". A more precise statement is that there are elementary functions whose indefinite integrals are not elementary. For example, the indefinite integral $\int e^{x^2}\; dx$ is not an elementary function, although it can be expressed in terms of a non-elementary special function as $\frac{\sqrt{\pi}}{2} \text{erfi}(x)$.

Your example $\int e^{\cos(x)}\; dx$ is also non-elementary. This can be proven using the Risch algorithm. This one does not seem to have any non-elementary closed form either.


That particular integral is easy enough to compute numerically to any accuracy you want.

You could also find a series solution. $e^{\cos x}$ is a power series in $\cos x$, and the integrals of powers of $\cos x$ are well known. Proving convergence is simple - since $\cos x$ is periodic, you only need to consider the interval $[0, 2\pi]$.


You're asking various different questions here since existence, computability and having a closed-form are all separate aspects of functions and integrals. To show you how, let's embark on a journey to make the nastiest function we can. It's interesting and important to recognise the distinction between different terms and pathological cases are a good way of differentiating between them.

All the functions you will have encountered until high-school have closed form integrals. This means we can neatly write their integral using other "simple" functions. This includes trigonometric functions, exponentials and polynomials; e.g. $\int \frac12x^2+2\ \mathrm{d}x=\frac{1}{6}x^3+2x+C$.

However, we can prove that some simple-looking functions have no closed form integral. As the other answers point out, it is impossible to write $\int e^{-x^2}\ \mathrm{d}x$ using simple functions but we can still compute the numerical value of the integral: $\int_0^1e^{-x^2}\ \mathrm{d}x\approx0.747$. Clearly our function isn't nasty enough yet.

We can't always compute the value of some functions or even some numbers. There are some uncomputable numbers that, despite existing, can't be found numerically; it's impossible to know what their value is. The most famous of these are Chaitin's constants, Ω. So, let's throw one into the mix. With $\int_0^1e^{-x^2}+\Omega\ \mathrm{d}x$ it's not just impossible to write the function in a closed form but now we can't even compute its value! Pretty nasty but can we get worse?

With that last integral, we couldn't find its value but it did have a value. Can we make a function where it's impossible to even integrate it? The Dirichlet function, $I_\mathbb{Q}(x)$, manages this. It's equal to $1$ at the rational numbers but $0$ everywhere else. Essentially, the $0$'s and $1$'s are too close to each other for us to be able to tell them apart so it can't be integrated.

There are many other ways we can describe functions and further narrow the qualities we've listed with different types of integration, computability and closed-forms.

enter image description here