Ok after plowing through MSE posts my confusion has finally reached its climax.
Say I would like to obtain a formula as simple as
$$\int_{\mathbb{R}} f \partial_x \overline{g} dx = -\int_{\mathbb{R}} \partial_x f \overline{g} dx$$
If $f,g,f',g'$ are $L^2(\mathbb{R})$ functions, then these integrals are well-defined. Using the Fourier transform we can even prove this formula, using $\widehat{f'} = -i\xi\widehat{f}$. So far so good.
But what about boundary terms?
By integration by parts, we would obtain
$$\int_{\mathbb{R}} f \partial_x \overline{g} dx = f\overline{g}|_{-\infty}^{\infty}-\int_{\mathbb{R}} \partial_x f \overline{g} dx$$
So in order to reconcile these two equations, we need $\lim_{|x|\rightarrow \infty} f\overline{g} = 0$. But this is certainly not the case for arbitrary $L^2(\mathbb{R})$ functions. So what the heck is going on?
Since I assume $f,g \in H^1(\mathbb{R})$ we know that $f$ and $g$ already go to zero at infinity. But then does that mean boundary terms always vanish in $H^1(\mathbb{R})$?
But then, when would there be boundary terms in the first place? In order to define these integrals, I need the derivatives to lie in $L^2$, otherwise something like $\int f'\overline{g}$ doesn't make sense.
So in which situation would the boundary terms not vanish?
What am I not seeing here?
Am I going insane?
The Schwartz functions are dense in $L^2$, so it suffices that these operations can be done on them, and we can then extend to all of $L^2$. A function $f ∈ C^∞(ℝ^n)$ is Schwartz if for all multi-indices $α,β$ there exists constants $C_{αβ}$ such that $$ \sup_{x∈ℝ^n}|x^β∂^αf(x)| ≤ C_{αβ}. $$ In the one-dimensional case, $α$ and $β$ are just natural numbers. In particular, this means that $f(x) → 0$ as $|x|→∞$, and there will hence never be any boundary terms.
As you may be aware of, the usual formula for the Fourier transform, $\hat f(ξ) = ∫e^{-ix·ξ}f(x)\,\mathrm dx$, is not well-defined on $L^2$. It is, however, well-defined on Schwartz functions, and this allows us to extend the Fourier transform to $L^2$.