Examples of adding a constant to integration by parts.

Justifying that $$\begin{align} \int_{0}^{\infty} \frac{\sin x}{x} \, dx &= \int_{0}^{\infty} \int_{0}^{\infty}\sin x \ e^{-xt} \, dt \, dx = \int^{\infty}_{0} \int_{0}^{\infty} \sin x \ e^{-tx} \, dx \, dt \\ &= \int_{0}^{\infty} \frac{1}{1+t^{2}} \, dt = \frac{\pi}{2} \end{align}$$

is not trivial due to the fact that the iterated integral does not converge absolutely.

But if we integrate by parts first and choose the antiderivative $1-\cos x$ for $v$, then

$$ \begin{align} \int_{0}^{\infty} \frac{\sin x}{x} \, dx &= \int_{0}^{\infty}\frac{1- \cos x}{x^{2}} \, dx = \int^{\infty}_{0} \int_{0}^{\infty} (1- \cos x) \, t e^{-xt} \, dt \, dx \\ &= \int_{0}^{\infty} t \int_{0}^{\infty} (1- \cos x) e^{-tx} \, dx \, dt = \int_{0}^{\infty} t \left(\frac{1}{t} - \frac{t}{1+t^{2}} \right) \, dt \\ &= \int_{0}^{\infty} \frac{1}{1+t^{2}} \, dt = \frac{\pi}{2} \, , \end{align}$$

where the justification for switching the order of integration comes from the fact the the integrand is always nonnegative (Tonelli's theorem).

EDIT:

Another example where it's useful to add a constant is for finding a primitive of $ \displaystyle \frac{\log x}{x+a}$.

If we assume that $a > 0$ and choose $\log(x+a) - \log(a) = \log \left(1+ \frac{x}{a} \right)$ for $v$, we get

$$ \begin{align}\int \frac{\log x}{x+a} \, dx &= \log(x) \log \left(1+ \frac{x}{a}\right) - \int \frac{1}{x} \, \log \left(1+ \frac{x}{a} \right) \, dx \\ &= \log(x) \log \left(1+ \frac{x}{a}\right) + \text{Li}_{2} \left(- \frac{x}{a} \right) +C . \tag{1}\end{align}$$

$(1)$ https://en.wikipedia.org/wiki/Polylogarithm#Dilogarithm


Here are a couple of simple examples where this applies:

1) $\int x\tan^{-1}x\;dx$, taking $v=\frac{1}{2}x^2+\frac{1}{2}$

2) $\int x\ln(x+1)\;dx$, taking $v=\frac{1}{2}x^2-\frac{1}{2}$


  • It's very useful to study : $\displaystyle\sum_{k=0}^{+\infty} \frac{\sin \pi\sqrt{n}}{n^\alpha}$ where $\alpha \in \mathbb{R}$

Let $\alpha\leq1$ and denote $(t)=\frac{\sin \pi\sqrt{n}}{n^\alpha}$ By integration by parts $$ \displaystyle\int_{n}^{n+1}f(t)dt-f(n)=\displaystyle\int_{n}^{n+1}(f(t)-f(n))dt $$ $$ =\left[(t-n-1)\bigr(f(t)-f(n)\bigl)\right]_n^{n+1}+\int_{n}^{n+1}(n+1-t)f'(t)dt $$ Thus, $$ \displaystyle\int_{n}^{n+1}f(t)dt-f(n)=\int_{n}^{n+1}(n+1-t)f'(t)dt $$ Then, $$ |\displaystyle\int_{n}^{n+1}f(t)dt-f(n)| \leq \displaystyle\int_{n}^{n+1}\bigr(\frac{\pi}{2t^{\alpha+\frac{1}2}}+\frac{|\alpha|}{t^{\alpha+1}}\bigl)dt=v_n $$ For $\alpha \geq \frac{1}2$ it's easy to conclude, for $\alpha \leq \frac{1}2$ you can use Cauchy criterion.


  • This technique is used to maintain the convergence of integrals

Let $\displaystyle\int_{0}^{+\infty}\frac{sin(t)}{t}dt$, by integration by parts, for $x>0$ $$ \displaystyle\int_{0}^{x}\frac{sin(t)}{t}dt=\left[\frac{1-cos(t)}t\right]_0^{x}+\int_{0}^{x}\frac{1-cos(t)}{t^2}dt $$


Let $I_n=\int_{0}^{n}\bigr(1-\frac{t}n\bigl)^n\ln(t) dt$. Then $I_n=\frac{n}{n+1}\bigr(ln(n)-\displaystyle\sum_{k=1}^{n+1} \frac{1}k\bigl)$.

Using $u=\frac{t}n$, we have $$ I_n=n\int_{0}^{1}\bigr(1-u\bigl)^n\ln(nu) du=nln(n)\int_{0}^{1}\bigr(1-u\bigl)^ndu+n\int_{0}^{1}\bigr(1-u\bigl)^nln(u)du $$ $$ =\frac{-1}{n+1}(1-u)^{n+1}+n\int_{0}^{1}\bigr(1-u\bigl)^nln(u)du $$ Then take $u\mapsto \frac{-1}{n+1}\bigr((1-u)^{n+1}-1\bigl)$ as primitive for $u\mapsto (1-u)^n$. Use integration by parts to conclude and the fact that $x^{n+1}-1=(x-1)(x^n+\cdots+1)$.