In his textbook Calculus, Spivak presents integration by parts as follows:
If $f'$ and $g'$ are continuous then \begin{align*} \int fg'&=fg-\int f'g\\ \int f(x)g'(x)\,dx&=f(x)g(x)-\int f'(x)g(x)\,dx\\ \int_a^b f(x)g'(x)\,dx&=f(x)g(x)\bigg|_a^b-\int_a^b f'(x)g(x)\,dx\\ \end{align*} I understand that without the continuity requirement, $fg'$ and $gf'$ may not be integrable, but why isn't it enough to have $f'$ and $g'$ be integrable functions? Isn't the product of two Riemann-integrable functions necessarily Riemann-integrable?
The "counterexample" in the linked paper is relevant for improper integrals.
In the example, $f(x) = x^2 \sin(x^{-4})$ and $g(x) = x^2 \cos(x^{-4})$ on $[0,1]$ with $f(0), g(0) := 0$, and
$$\sin(1)\cos(1) = \int_0^1 (fg’ + gf’) \neq \int_0^1fg’ + \int_0^1 g f’,$$
since the integrals on the RHS do not exist as Riemann integrals (nor as finite Lebesgue integrals).
For more details, note that $f$ and $g$ are differentiable with $f'(0) = g'(0) = 0.$
On $(0,1]$ we have,
$$f'(x) = 2x \sin(x^{-4}) - 4 x^{-3}\cos(x^{-4}), \\ g'(x) = 2x \cos(x^{-4}) + 4 x^{-3}\sin(x^{-4}),\\ f(x)g(x) = \frac{1}{2}x^4 \sin(2 x^{-4}), \\ (fg)'(x) = 2x^2 \sin(2x^{-4}) - 4 x^{-1}\cos(2x^{-4}) $$
Notice that $f(x)g'(x) = 2x^3\sin(x^{-4})\cos(x^{-4})- 4x^{-1} \sin^2(x^{-4})$ where the second term does not have a convergent improper integral over $[0,1]$.