# Are some indefinite integrals impossible to compute or just don't exist? [duplicate]

I've just started working with integrals relatively recently and I am so surprised how much harder they are to compute than derivatives. For example, for something as seemingly simple as $$\int e^{ \cos x} dx$$ is impossible right? I can't use u-sub since there is no $$-\sin(x)$$ multiplying the function, also integration by parts seems like it wouldn't work, correct? So does this mean this integral is impossible to compute?

• Some integrals cannot be expressed in terms of elementary functions that you deal with on a normal basis but can be expressed with other functions. Commented Aug 2, 2019 at 1:44
• But those "other functions" often turn out to be defined as definite integrals in the first place. Commented Aug 2, 2019 at 14:20
• @Teepeemm If biologists don't know what something is for, they say it is for attracting mates. If archaeologists don't know what something is for, they say it is a religious object. If mathematicians can't do an integral, they call it a "special function" (preferably named after themselves). Commented Aug 3, 2019 at 4:53
• @Teepeemm : They can be, but they can also be defined in other ways, too. You can also think of it as that integration effectively, itself, expands the set of "reachable" functions. Commented Aug 3, 2019 at 7:34
• Commented Aug 3, 2019 at 15:58

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.

• But erfi is defined in terms of a definite integral of $e^{x^2}$, so saying $\int e^{x^2}dx=\frac{\sqrt\pi}2\mathrm{erfi}(x)+C$ is more a definition of the latter than a useful insight. Which often happens with functions that don't have an elementary anti-derivative. Commented Aug 2, 2019 at 14:29

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.

• +1 for the nice diagram, and for mention of Chaitin's constants (new to me). Also distinguishing between existence, computability and having a closed-form is very useful. Commented Aug 3, 2019 at 20:35

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]$$.