I have seen the following equation I can't follow: $$ \mathbb{E}\left[\int_0^Tf(s,X_s)ds B_T\right] = \int_0^T\mathbb{E}(f(s,X_s)B_s)ds$$ where $(B)_t$ is a standard Brownian motion and $(X)_t$ is an Itô-process driven by $B$.
I am pretty sure, the last step is applying Fubini's theorem, which would break it down to the following equation $$\mathbb{E}\left[\int_0^Tf(s,X_s)ds B_T\right] =\mathbb{E}\left[\int_0^Tf(s,X_s)B_s ds\right].$$ My approach would be to write $B_T$ as $\int_0^T1dB_s$ and maybe $ds$ as $[B]_s$, but I have no idea how to proceed. Many thanks in advance!
By Fubini's theorem we have
$$\mathbb{E} \left( \int_0^T f(s,X_s) \, ds B_T \right) = \int_0^T \mathbb{E}(f(s,X_s) B_T) \, ds. \tag{1}$$
It follows from the tower property and the fact that $t \mapsto B_t$ is a martingale that
\begin{align*} \mathbb{E}(f(s,X_s) B_T) &= \mathbb{E} \bigg( \mathbb{E}(f(s,X_s) B_T \mid \mathcal{F}_s) \bigg) \\ &= \mathbb{E} \bigg( f(s,X_s) \mathbb{E}(B_T \mid \mathcal{F}_s) \bigg) \\ &= \mathbb{E}(f(s,X_s) B_s) \end{align*}
for any $s \leq T$. Plugging this into $(1)$ gives
$$\mathbb{E} \left( \int_0^T f(s,X_s) \, ds B_T \right) = \int_0^T \mathbb{E}(f(s,X_s) B_s) \, ds.$$