# Infinite Integration by Parts

A while back, I was explaining to a friend a method to compute the indefinite integral of $$ln(x)\ln(x)$$, by taking $$∫ln(x)dx\int \ln(x) \, dx$$ and setting $$u=ln(x),du=1xdx,dv=1dx,v=xu = \ln(x), du = \frac{1}{x} \, dx, dv = 1 \, dx, v = x$$, then proceeding with integration by parts. However, I was wondering if this method could be generalized for any infinitely differentiable function $$f(x)f(x)$$, so I attempted the same method. Below is what I computed:

$$∫f(x)dx\int f(x) \, dx$$, so let $$u=f(x),du=f′(x)dx,dv=1dx,v=x⟹u = f(x), du = f'(x)\,dx, dv = 1\, dx, v = x \implies$$

$$xf(x)−∫xf′(x)dxx f(x) - \int x f'(x) \, dx$$, so let $$u=f′(x),du=f″u = f'(x), du = f''(x) \, dx, dv = x \, dx, v = \frac{x^2}2 \implies$$

$$xf(x) – \frac{x^2} 2 f'(x) + \int \frac{x^2}2 f”(x) \, dxxf(x) - \frac{x^2} 2 f'(x) + \int \frac{x^2}2 f''(x) \, dx$$, so let $$u = f”(x), du = f”'(x) \, dx, dv = \frac{x^2} 2 \, dx, v = \frac{x^3} 6 \ldotsu = f''(x), du = f'''(x) \, dx, dv = \frac{x^2} 2 \, dx, v = \frac{x^3} 6 \ldots$$

This eventually yields $$\int f(x) \, dx= \sum_{n=1}^\infty \frac{x^n}{n!} (-1)^{n – 1} f^{(n-1)}(x),\int f(x) \, dx= \sum_{n=1}^\infty \frac{x^n}{n!} (-1)^{n - 1} f^{(n-1)}(x),$$ where $$f^{(n-1)}(x)f^{(n-1)}(x)$$ represents the $$(n-1)(n-1)$$-th derivative of $$f(x)f(x)$$ . At first glance, while this looks like a Taylor expansion, it is actually quite different. Firstly, the general Taylor expansion does not contain the $$(-1)^{n-1}(-1)^{n-1}$$ term that this sum does. Secondly, Taylor expansions are centered around some point, while this sum is not. Finally, and perhaps most notably, in a Taylor expansion, the derivatives are evaluated at a specific point, while in this expansion, they are left as functions. My questions, then, are the following:

1. Is this something new, or has it been documented before? (I’ve spent a lot of time looking to see if I could find something similar, and so far this has yielded nothing. But, if it has been done, I’d love to read more about it)

2. If this is novel (or even if it is not), what are some of the interesting consequences of this expression?

I really do appreciate all of your input and advice. I realize this is a little open ended, but it’s been nagging at me for quite some while, and I’d love a second look. Thanks!

EDIT: As Alex Kruckman pointed out in the comments, the claim ‘this eventually yields’ leads to a loss of precision, specifically as it pertains to the $$+C+C$$ term in an indefinite integral. After spending some time thinking about this, I noted several remedies to this issue:

1. Rather than express the integral as an infinite sum, we can represent it as a finite sum added to an ‘error’ term of sorts. In other words, we can say:

$$\int f(x)\, dx = \sum_{n=1}^k\left[\frac{x^n}{n!} (-1)^{n – 1} f^{(n-1)}(x)\right] + \int \frac{x^k}{k!}(-1)^{k}f^{(k)}(x) \, dx\int f(x)\, dx = \sum_{n=1}^k\left[\frac{x^n}{n!} (-1)^{n - 1} f^{(n-1)}(x)\right] + \int \frac{x^k}{k!}(-1)^{k}f^{(k)}(x) \, dx$$

1. Interestingly, when considering the infinite sum, we note that every term has a polynomial component of at least degree one. This implies that if $$x = 0x = 0$$, the sum should evaluate to $$00$$ as well. Therefore, setting $$G(x) = \int_{a}^{x} f(t) \, dt = F(x) – F(a)G(x) = \int_{a}^{x} f(t) \, dt = F(x) - F(a)$$, we see that as $$G(0) = 0G(0) = 0$$, $$F(0) – F(a) = 0,F(0) - F(a) = 0,$$ which implies $$a = 0a = 0$$. In other words, to make my original claim more precise, we can use the definite integral:

$$\int_{0}^{x} f(t) \, dt= \sum_{n=1}^\infty \frac{x^n}{n!} (-1)^{n – 1} f^{(n-1)}(x)\int_{0}^{x} f(t) \, dt= \sum_{n=1}^\infty \frac{x^n}{n!} (-1)^{n - 1} f^{(n-1)}(x)$$

I believe these two edits help to eliminate the problem with the $$+C+C$$ term.

EDIT 2: I’ve tried a couple common functions to see how they interact with the formula. Considering $$f(x) = e^xf(x) = e^x$$, we have:

\begin{aligned}\int e^x \, dx&= \sum_{n=1}^\infty\frac{x^n}{n!} (-1)^{n – 1}e^x\\e^x + C &= e^x\cdot\sum_{n=1}^\infty\frac{x^n}{n!} (-1)^{n – 1}\\&= e^x\cdot(1 – e^{-x})=e^x-1\end{aligned}\begin{aligned}\int e^x \, dx&= \sum_{n=1}^\infty\frac{x^n}{n!} (-1)^{n - 1}e^x\\e^x + C &= e^x\cdot\sum_{n=1}^\infty\frac{x^n}{n!} (-1)^{n - 1}\\&= e^x\cdot(1 - e^{-x})=e^x-1\end{aligned}

This implies $$C = -1C = -1$$, a result consistent with the first edit, where we integrate from $$00$$ to $$xx$$.

Similarly, considering $$f(x) = e^{-x}f(x) = e^{-x}$$, we have:

\begin{aligned}\int e^{-x} \, dx= \sum_{n=1}^\infty \frac{x^n}{n!} (-1)^{n – 1} e^{-x} * (-1)^{(n-1)} = \sum_{n=1}^\infty \frac{x^n}{n!} * e^{-x}\\-e^{-x} + C = e^{-x} * \sum_{n=1}^\infty \frac{x^n}{n!} = e^{-x} * (e^x – 1) = 1 – e^{-x}\end{aligned}\begin{aligned}\int e^{-x} \, dx= \sum_{n=1}^\infty \frac{x^n}{n!} (-1)^{n - 1} e^{-x} * (-1)^{(n-1)} = \sum_{n=1}^\infty \frac{x^n}{n!} * e^{-x}\\-e^{-x} + C = e^{-x} * \sum_{n=1}^\infty \frac{x^n}{n!} = e^{-x} * (e^x - 1) = 1 - e^{-x}\end{aligned}

This implies $$C = 1C = 1$$, which we would again get if we integrated from $$00$$ to $$xx$$.

Now, I decided to consider $$f(x) =\ln(x)f(x) =\ln(x)$$, a decidedly harder function to analyze in this respect, which also is not defined at 0. Here, we have:

\begin{aligned}\int\ln(x) \, dx&=\sum_{n=1}^\infty\frac{x^n}{n!}(-1)^{n – 1}\frac{d^{(n-1)}}{dx^{(n-1)}}\ln(x)\\x\cdot\ln(x)-x+C&=x\cdot\ln(x)+\sum_{n=2}^\infty\frac{x^n}{n!} (-1)^{n – 1} \frac{d^{(n-1)}}{dx^{(n-1)}}\ln(x)\\&=x\cdot\ln(x)-x+C&=x\cdot\ln(x)+\sum_{n=2}^\infty\frac{x^n}{n!} (-1)^{n – 1} \frac{(n-2)!}{x^{n-1}}\cdot(-1)^n\\x\cdot\ln(x)-x+C&=x\cdot\ln(x)-\sum_{n=2}^\infty\frac{x}{n(n-1)}\\&=x\cdot\ln(x)-x\end{aligned}\begin{aligned}\int\ln(x) \, dx&=\sum_{n=1}^\infty\frac{x^n}{n!}(-1)^{n - 1}\frac{d^{(n-1)}}{dx^{(n-1)}}\ln(x)\\x\cdot\ln(x)-x+C&=x\cdot\ln(x)+\sum_{n=2}^\infty\frac{x^n}{n!} (-1)^{n - 1} \frac{d^{(n-1)}}{dx^{(n-1)}}\ln(x)\\&=x\cdot\ln(x)-x+C&=x\cdot\ln(x)+\sum_{n=2}^\infty\frac{x^n}{n!} (-1)^{n - 1} \frac{(n-2)!}{x^{n-1}}\cdot(-1)^n\\x\cdot\ln(x)-x+C&=x\cdot\ln(x)-\sum_{n=2}^\infty\frac{x}{n(n-1)}\\&=x\cdot\ln(x)-x\end{aligned}

Interestingly, here, we see that $$C = 0C = 0$$. While $$ln(x)ln(x)$$ is not defined at $$00$$, this intuitively still makes some sense, as we note $$\lim\limits_{x\to0} (x\cdot\ln(x) – x) = 0\lim\limits_{x\to0} (x\cdot\ln(x) - x) = 0$$.

This is a restatement of the proof of Taylor’s theorem using integration by parts. We have Now we put $g(x) = \int_{a}^{x} f(t) \, dt$ to get Putting $x=0$ in the above equation we get your formula with $a$ in place of $x$.
It is no wonder that you used integration by parts to arrive at your formula because the equation $(1)$ above is also obtained via integration by parts and is presented in a routine manner in many textbooks and also on Wikipedia. But since you arrived at this sincerely by your own efforts hats off to you! +1 for your question.