I occasionally see a post here: Integral of brownian motion wrt. time over [t;T].
This post has the conclusion that $\int_t^T W_s ds = \int_t^T (T-s)dB_s$.
However, here is my derivation which is different from him and I don't know where I am wrong.
First, we have:
$$\mathrm{d}(uB_u) = u \mathrm{d} B_u + B_u \mathrm{d} u.$$
Then, integral from $s$ to $t$, we have:
$$tB_t - sB_s = \int_{s}^{t} u \mathrm{~d}B_u + \int_{s}^{t} B_u \mathrm{~d} u$$
\begin{equation} \begin{aligned} \int_{s}^{t} B_u \mathrm{~d}u &= tB_t - sB_s - \int_{s}^{t} u \mathrm{~d}B_u\\ &= \int_{0}^{t} t \mathrm{~d}B_u - \int_{0}^{s} s \mathrm{~d} B_u - \int_{s}^{t} u \mathrm{~d} B_u\\ &= \int_{0}^{s} t \mathrm{~d} B_u + \int_{s}^{t} t \mathrm{~d}B_u - \int_{0}^{s} s \mathrm{~d}B_u - \int_{s}^{t} u \mathrm{~d}B_u\\ &= \int_{0}^{s}(t - s)\mathrm{~d}B_u + \int_{s}^{t} (t - u) \mathrm{~d} B_u\\ &= (t - s)B_s + \int_{s}^{t} (t - u) \mathrm{~d}B_u. \end{aligned} \end{equation}