The following problem is 1.3 in Baldi's Stochastic calculus:
Let $X$ be a positive r.v. and $f: \mathbb{R}^+ \rightarrow \mathbb{R}$ be a differentiable function with a continuous derivative such that $f(X)$ is integrable. Show that $$\Bbb E[f(X)] = f(0) + \int_0^{+\infty} f'(t)P(X\geq t)\,dt.$$
Baldi argues as follows:
Let us denote the law of $X$ by $\mu$. By the integration rule with respect to an image law (Proposition 1.1), and by Fubini's theorem \begin{align}\Bbb E[f(X)] &= \int_0^{+\infty}f(x)\,d\mu(x) = \underbrace{\int_0^{+\infty}\,d\mu(x)\left( f(0)+\int_0^x f'(t)\,dt\right)}\\&=f(0) +\int_0^{+\infty}f'(t)\,dt\int_t^{+\infty}\,d\mu(x) = f(0)+\int_0^{+\infty}f'(t)\operatorname P(X\geq t)\,dt.\end{align}
I underbraced the part that slightly confuses me. I understand that we can use the fundamental theorem of calculus to write $f(x) = \int_0^xf'(t)\,dt$, but how exactly does he decompose the term $f(0).$ The notation he uses, with $d\mu(x)$ seemingly multiplied with the decomposition of $f(x)$ also puzzles me a bit. I might be missing something very trivial here, any hint would be appreciated. I have some experience with measure and integration theory. The exercise was given as the first exercise in a course on stochastic calculus, and is meant as a preliminary exercise.
By the Fundamental Theorem of Calculus, $$\int_0^xf'(t)\,dt=f(x)-f(0),$$ so we have $$\int_0^{+\infty}f(x)\,d\mu(x) =\int_0^{+\infty}\left( f(0)+\int_0^x f'(t)dt\right)\,d\mu(x).$$ Note that putting $d\mu(x)$ at the front is also allowed (and has the same meaning) provided it is not ambiguous. Thus \begin{align}\int_0^{+\infty}f(x)\,d\mu(x)&=\int_0^{+\infty}f(0)\,d\mu(x)+\int_0^{+\infty}f'(t)\,dt\int_t^{+\infty}d\mu(x) \\&= f(0)\operatorname P(X\ge0)+\int_0^{+\infty}f'(t)\operatorname P(X\geq t)\,dt\\&= f(0)+\int_0^{+\infty}f'(t)\operatorname P(X\geq t)\,dt\end{align} as required, since $X$ is a positive random variable.