Why is differentiating mechanics and integration art?

One relevant thing here is that you are referring to differentiating and integrating within the class of so-called elementary functions, which are built recursively from polynomials and complex exponential and logarithmic functions and taking their closure under the arithmetic operations and composition. Here one can argue by recursion to show that the derivative of an elementary function is elementary, but the antiderivatives might not be elementary. This should surprise one no more than the fact than the square of a rational number is rational, but the square root of a rational number might be irrational. (The analogy isn't completely idle, as shown by differential Galois theory.)

In other words, the symmetry you refer to is really based on much wider classes of functions (e.g. continuous and continuously differentiable functions), far beyond the purview of the class of elementary functions.

But let's put that aside. The question might be: is there a mechanical procedure which will decide when an elementary function has an elementary antiderivative (and if it does, exhibit that antiderivative)? There is an almost-answer to this, the so-called Risch algorithm, which I believe is a basis for many symbolic integration packages. But see particularly the issues mentioned in the section "Decidability".

There is another interesting asymmetry: in first-order logic, derivatives are definable in the sense that given some expansion of the structure of real numbers, say for example the real numbers as an exponential field, the derivative of a definable function is again definable by a first-order formula. But in general there is no purely first-order construction of for example the Riemann integral (involving quantification over finer and finer meshes). I seem to recall that there are similar difficulties in getting a completely satisfactory notion of integration for recursively defined functions on the surreals, due in part to the incompleteness (i.e., the many holes) in the surreal number line.


I want to try a different way of answering the question of why differentiation is somehow the "primary" operation and anti-differentiation the inverting operation. I'll try to make it as elementary as possible.

First let me say what I don't count as an answer. (This is not supposed to be a new contribution to the discussion -- just making my starting point explicit.) It's not enough to point out that differentiation obeys the product and chain rules and explicit differentiability of 1/x (thereby giving the quotient rule as well) and that anti-differentiation doesn't. Somehow one wants an answer that explains why we should have expected this in advance. I was going to say something about differentiation tending to simplify functions, but then realized that that's not really true: it may be true for polynomials but there are lots of functions for which it's false.

The small suggestion I wanted to make was to discretize the question and think about summation versus taking difference functions. Here the situation is slightly confusing because expressions like $\sum_{n=1}^Nf(n)$ tend to come up more often than expressions like $f(n)-f(n-1)$. But let's forget that and think about what it is that we have to do if we want to work out $\sum_{n=1}^Nf(n)$ explicitly. Usually we need to guess a function g and prove that $g(n)-g(n-1)=f(n)$ for every $n$, from which it follows by induction that $g(N)=\sum_{n=1}^Nf(n)+g(0)$. This (the finding of the function $g$) is a discrete analogue of anti-differentiating.

Looked at this way, to work out the sum we have to solve the functional equation $g(n)-g(n-1)=f(n)$ (where we are given $f$ and are required to solve for $g$). By contrast, when we work out the difference function we are solving the similar looking, but much easier, functional equation $g(n)=f(n)-f(n-1)$. It's much easier because the unknown function is involved only once: indeed, in a sense there's nothing to solve at all, but experience shows that we can usually simplify the right-hand side. Of course, with the first equation we can't simplify the left-hand side in a similar way because we don't know what $g$ is.

It's a bit like the difference between solving the equation $x^2+x=10$ and solving the equation $x=10^2+10$ (that is, the difference between algebra and arithmetic). So here is a real sense, in a closely analogous situation, where one operation is direct and the other is indirect and involves solving for something.


Differentiation is inherently a (micro-)local operation. Integration is inherently a global one.

EDIT: the reason that locality helps with symbolic differentiation of elementary functions (and is not present to help with symbolic integration of the same functions) is that the basic arithmetic operations used to build elementary functions are simpler locally than they are globally. In particular, multiplication and division become linear in the infinitesimal variables,

$$ (f + df) (g + dg) \approx fg + f dg + g df$$

$$ \frac{f+df}{g+dg} \approx \frac{f}{g} + \frac{g df - f dg}{g^2},$$

leading of course to the product and quotient rules which are two of the primary reasons why symbolic differentiation is so computable.

Note that properties such as holomorphicity, mentioned in the comments, are not quite as local as differentiation, because in order to be holomorphic at a point, one must not only be complex differentiable at a point, but also complex differentiable on a neighbourhood around that point. (In the jargon of microlocal analysis, it is merely a local property rather than a microlocal one.)

Finally, the reason why the inverse of a local operation (differentiation) is global is because differentiation is not locally injective (constants have zero derivative). In order to eliminate this lack of injectivity, one needs to impose a global condition, such as a vanishing at one endpoint of the domain.

SECOND EDIT: Another way to see the relationship between locality and computational difficulty is to adopt a computational complexity perspective. A Newton quotient, being local, only requires O(1) operations to compute. On the other hand, a Riemann sum, being global, requires O(N) operations to compute, where N is the size of the partition. This helps explain why the former operation preserves the class of elementary (or bounded complexity) functions, while the latter does not.

(This is only if one works in the category of exact calculation. If one is instead interested in numerical calculation and is willing to tolerate small errors, then the situation becomes reversed: numerical integration, being more stable than numerical differentiation, usually has lower complexity thanks to tools such as quadrature. Here, one can turn the global nature of integration to one's advantage, by allowing one to largely ignore small-scale structure, assuming of course that the integrand enjoys some regularity.)