I'm trying to show that if $g$ is such that $f(b) - f(a) = \int_a^b g(t) dt$ for any $a<b \in \mathbb{R}$ then we have: (for $f, g \in L^2(\mathbb{R})$)
$$\int_a^b f(t)g(t) = \frac{1}{2}(f(b)^2 - f(a)^2)$$
I can see this would follow if we could treat $g$ as the derivative of $f$ and use integration by parts but I'm not quite sure how to justify this.
Thanks for any help