For simplicity let our space be $\mathbb R$.
Let $T:\mathcal D(\mathbb R) \rightarrow \mathbb R$ be a distribution such that it's distributional derivative $T':\mathcal D(\mathbb R) \rightarrow \mathbb R$ is locally in $L^2$, i.e. there is a locally $L^2$ function $f:\mathbb R \rightarrow \mathbb R$ such that $T'(\varphi)=\int_\mathbb R f\varphi dt$ for all $\varphi \in \mathcal D(\mathbb R)$.
Prove or disprove: $T$ is locally in $L^2$, i.e. there is a function $g$ such that $T(\phi)=\int_\mathbb R g\phi dt$ for all $\varphi \in \mathcal D(\mathbb R)$.
The most natural candidate is $g(x)=\int_0^xf(t)dt$. As $f$ is locally $L^2$, $g$ is bounded on compact sets and hence is locally in $L^2$. The next question is why does $T(\phi)=\int_\mathbb R g\phi dt$ for all $\varphi \in \mathcal D(\mathbb R)$?
For all test functions $\phi$ with $\int \phi =0$ we have \begin{align*} T\left(\phi\right) &=-T'\left(\int_0^x\phi\right)\\ &= -\int_\mathbb R f(t)\left(\int_0^t\phi\right) dt \end{align*}
Questions:
- How to rewrite the last integral as $\displaystyle\int_\mathbb R \phi(t)\left(\int_0^tf\right) dt=\int_\mathbb R \phi g \ dt$. This can be done by integration by parts if $f$ were continuous, but we don't have that here.
- Even if we show 1, we will have $T(\phi)=\int_\mathbb R \phi g \ dt$ only for test functions $\phi$ with integral zero. Does this imply it holds for any other test function with non-zero integral?
tldr: Your $g$ is right up to a constant offset. Also, the general ‘rule’ is that derivatives are worse behaved than integrals.
The function $g$ is continuous on $\Bbb{R}$, differentiable a.e, with $g’=f$ a.e (this is the Lebesgue version of the FTC). Now, for any $\phi\in \mathcal{D}(\Bbb{R})$, \begin{align} \langle T,\phi’\rangle&=:-\langle T’,\phi\rangle\\ &=-\int_{\Bbb{R}}f\phi\,dt\\ &=-\int_{\Bbb{R}}g’\phi\,dt\tag{$g’=f$ a.e}\\ &=\int_{\Bbb{R}}[g\phi’-(g\phi)’]\,dt\tag{product rule a.e}\\ &=\int_{\Bbb{R}}g\phi’\,dt-0, \end{align} and in the final equal sign, we use the FTC and that $\phi$ has compact support. Note that the product rule/integration by parts was valid because $g$ is differentiable a.e, so at those points, we can apply the product rule $(g\phi)’=g’\phi+g’\phi$.
Let $T_g$ denote the distribution induced by $g$. What this shows is that $\langle T,\phi’\rangle=\langle T_g,\phi’\rangle$, and hence $\langle T-T_g,\phi’\rangle=0$, and hence $\langle T’-T_g’,\phi\rangle=0$ for all $\phi$, which means $(T-T_g)’=0$. If a distributional derivative vanishes on $\Bbb{R}$, then the distribution is (represented by) a constant (I hope you’ve seen this fact, otherwise try proving it yourself, or looking up on this site) $T-T_g=T_{\text{const}}$. Therefore, $T$ is represented by the (continuous, differentiable a.e) function $x\mapsto g(x)+C=\int_0^xf\,dt+C$ for some constant $C$.