Can we derive results from infinite sequences of integration by parts? I remember from my school days some old trick with integrals where if $\sin$ or $\cos$ were involved, we could sometimes apply the partial integration theorem once or twice and express the first integral in terms of itself in a way which let us solve it. An example:
$$I=\int\sin(x)^2dx = x -\int \cos(x)^2dx = x - \sin(x)\cos(x) - \int \sin(x)^2dx$$
Now rearranging gives $$2I = x-\sin(x)\cos(x)$$
Which we can verify.
Now to the question, can this be applied in a more general setting?
For example if we do not after a finite set of steps end up with a closed form expression, could we use a series of integrals which might arise from iterating the integration-by-parts indefinitely? Are there any particular problems solvable this way which aren't solvable otherwise?
 A: I think a good example is the erfc function expanded around $x = \infty$:
\begin{align} \text{erfc}(x) &:= \frac1{\sqrt\pi}\int_x^\infty e^{-y^2} \, dy
\\ &= \frac1{\sqrt\pi}\int_x^\infty \frac 1y y e^{-y^2} \, dy
\\ &= \frac1{\sqrt\pi} \frac 1{2x} e^{-x^2} - \frac1{\sqrt\pi}\int_x^\infty \frac 1{2y^2} e^{-y^2} \, dy
\\ &= \frac1{\sqrt\pi} \frac 1{2x} e^{-x^2} - \frac1{\sqrt\pi}\int_x^\infty \frac 1{2y^3} y e^{-y^2} \, dy
\\ &= \frac1{\sqrt\pi} \frac 1{2x} e^{-x^2} - \frac1{\sqrt\pi} \frac 1{4x^3} e^{-x^2} + \frac1{\sqrt\pi}\int_x^\infty \frac 3{4y^4} e^{-y^2} \, dy
\\ & = \cdots
\end{align}
Note that the last term gives you a good estimate of the remainder.  For example
$$ \frac1{\sqrt\pi}\int_x^\infty \frac 3{4y^4} e^{-y^2} \, dy \le \frac1{\sqrt\pi} \frac 3{4x^4} \int_x^\infty e^{-y^2} \, dy < \frac1{\sqrt \pi} \frac 3{8x^5} e^{-x^2} .$$
(I may have got some details wrong, but I think you can see the idea.)
A: A nice example is going the "wrong way" on an easy integral to get the Maclaurin series of $e^x$.
$$
1-e^{-x}=\int_0^x e^{-t}\,dt;
$$
$$
1-e^{-x}=\int_0^x \underbrace{e^{-t}}_{u}\cdot \underbrace{1dt}_{dv} = x e^{-x} + \int_0^x t e^{-t}\,dt
$$
$$
= x e^{-x} +\frac{x^2}{2}e^{-x} + \frac{1}{2}\int_0^x t^2 e^{-t}{dt}
$$
$$
= x e^{-x} +\frac{x^2}{2}e^{-x} + \frac{x^3}{6}e^{-x}+ \frac{1}{6}\int_0^x t^2 e^{-t}{dt}
$$Then denoting $\displaystyle{I_n = \frac{1}{n!}\int_0^x t^{n-1}e^{-t}dt}$, we have
$$
1=e^{-x}\left(1+x+\frac{x^2}{2} + \cdots + \frac{x^n}{n!}\right) +I_n
$$Then for fixed $x$ we have
$$
\left|\lim_{n\to\infty}I_n\right|\le \lim_{n\to\infty}\frac{|x^n|}{n!}=0,
$$yielding
$$
1 = e^{-x}\left(1+x+\frac{x^2}{2} + \cdots\right);\qquad e^x = \sum_{n=0}^{\infty}\frac{x^n}{n!}
$$
