Is indefinite integration largely a heuristic or it can be mechanical too?

Due to criticism in the comments, I am limiting the scope of and rewriting my answer. I still think I have something to offer even though I admit my answer is not complete.

The scope of the question itself is not entirely clear. There are possibly three questions: (1) How to integrate any function symbolically? (2) Does a "product rule" for integrals exist? (3) How do you integrate any rational function. I think (2) is a very interesting one.

I'll address (2) and (3) but (1) is outside of my knowledge. I am aware of related terms such as differential algebra and differential galois theory and the risch algorithm which may shed insight but, again, I am not knowledgeable in this.


For (2):

I suspect you are hoping for a formula such as the following. Let us take inspiration from the product rule for derivatives which has the form $$\frac{d}{dx}(fg)=\lambda(f,f',g,g')$$ with $\lambda$ an elementary function defined as $\lambda(w,x,y,z)=wz+xy$. Let $F$ and $G$ be the antiderivatives of $f$ and $g$ respectively. Taking the differentiation case, you are hoping for a formula $$\int fg dx = \lambda(f,F,g,G)$$ where $\lambda$ is some sort of function that's "nice". Implicit also is the "plus C". Specifically, I would say it is made of elementary functions or less precisely, the sort of functions you find in pre-calc. (I admit this does not cover all bases, however, the following will give at least some insight.)

Now take the case of $f=1/x$, $F=\log x$, $g=\sin x$ and $G = -\cos x$. We'd hope for some expression

$$\int \frac{\sin x}{x} dx = \lambda (1/x, \log x, \sin x, -\cos x).$$

However, it is well known that there is no closed form to the integral of the the so-called sinc function $\sin x/x$ in terms of elementary functions. But if $\lambda$ takes in elementary functions and combines them in an elementary way, the above expression would also have to be elementary. So no "nicely expressed", or elementary formula for an "integral product rule" exists.

This tells us at the least it would be a beast of a problem to find such a function. But in a way, this is backwards since the real work of showing $(\sin x)/x$ has no nice indefinite integral is itself a hard problem.


For (3):

Let me remind how you can deal with quadratic factors in partial fractions such as $$r(x) = \sum \frac{p_i(x)}{q_i(x)}$$ where $q_i(x)$ is degree 2 and has complex roots and $p_i$ is degree 1 at most. Now you can always complete the square and add and subtract in the numerator to get a form $$\int \frac{2c(x-a)+d}{(x-a)^2+b^2} dx = \int \frac{2c(x-a)}{(x-a)^2+b^2} + \frac{d}{(x-a)^2+b^2} dx.$$ The first term evaluates to $c\log((x-a)^2+x)$. The second to $d/b \arctan[(x-a)/b]$.

This is not a thorough explanation of how to compute the antiderivatives of rational functions but I want to make you aware of this point.


First of all, there a few pointers. Always check for $u$-substitution, for if that is possible, then by all means please use. Secondly, we have integration by parts, designed for integrating products. And also, we have partial fraction decomposition, as explained in this answer.

There also happens to be this really nice answer that gives the solution to some special cases, which can be modified via substitutions to provide solutions to many hard integrals.