Why can't some functions be integrated? There are some functions (such as xtan(x)dx [without limits]) which can't be integrated, why? How can one understand which function is integrable or not?
 A: Why doesn't every function have an antiderivative?
Finding the indefinite integral of a function $f$, is the same as finding a function $F$ whose derivative is $f$. As explained here, this requires $f$ to be continuous.
If $f$ is discontinuous, then there may be some value $x$ such that $f(x)$ is undefined. When this happens, it means that $F'(x)$ does not exist, i.e. $F$ is not differentiable at $x$.
There are ways around this, however. For example, you can remove discontinuities or restrict the domain of $f$ so that it is continuous. There are increasingly obscure methods which can be used to integrate discontinuous functions, but I don't know much about them.
Stretching the definition of "integration" to its utmost extreme, I wouldn't be surprised if every function can be integrated.
Why can't every antiderivative be expressed in terms of elementary functions?
The integral of $x\tan(x)$ (ignoring discontinuities) is:
$$\frac{i}{2}(\text{Li}_2(-e^{2 i x}) + x (x + 2 i \ln(1 + e^{2 i x}))) + c$$
Where $i$ is the imaginary unit, and $\text{Li}_2$ is the polylogarithm of order 2. This is a special function, and cannot be expressed in terms of elementary functions.
The reason that antiderivatives cannot always be expressed in terms of elementary functions is that the set of elementary functions is not closed under limits in general. The specific fact that the integral of an elementary function is not always an elementary function is known as Liouville's Theorem.
