In the proof of Lemma 8.2 from Brezis' "Functional Analysis, Sobolev Spaces and PDE's", it is written:
$$ \int_I \bar{u}(x) \varphi^{\prime} (x)dx=\int_I\left(\int_{y_0}^x u'(t) d t\right)\varphi^{\prime}(x) d x $$ $$ =\int_a^{y_0} \left( -\int_x^{y_0} u'(t) \varphi^{\prime}(x)d t\right) d x+\int_{y_0}^b \left(\int_{y_0}^x u'(t) \varphi^{\prime}(x) d t\right)d x$$ $$=-\int_a^{y_0}\left( u'(t) \int_a^t \varphi^{\prime}(x) d x\right)d t+\int_{y_o}^b \left(u'(t) \int_t^b \varphi^{\prime}(x) d x\right) d t=-\int_I u'(t) \varphi(t) d t , $$ where $I=(a,b)$, $\varphi \in C_c^1(I)$, $u \in W^{1,p}(I)$ (and therefore $u' \in L^p(I))$, and $\bar{u}:[a,b] \to \mathbb{R}$ is given by $\bar{u}(x)=\int_{y_0}^x u'(t)dt$, $x \in I=[a,b]$ and $y_0 \in I$ fixed. I understood the application of Fubini's Theorem, but I didn't understand why the last equality holds.
By the fundamental theorem of calculus, $$\int_a^t \varphi'(x)\,dx = \varphi(t) - \varphi(a) \\ \int_t^b \varphi'(x)\,dx = \varphi(b) - \varphi(t)$$
On the other hand, $\varphi \in C_c((a,b))$ implies $\varphi(a) = 0 = \varphi(b)$.
Put it together, and you have $$-\int_a^{y_0}\left( u'(t) \int_a^t \varphi'(x)\,dx\right)\,dt+\int_{y_o}^b \left(u'(t) \int_t^b \varphi'(x)\,dx\right)\,dt = -\int_a^{y_0} u'(t)\varphi(t)\,dt + \int_{y_0}^b u'(t)(-\varphi(t))\,dt$$