TITLE: Compute: $\mathbb{E}\left[\left(\dfrac{1}{T}\int^T_0W_tdt\right)^2\right]$
QUESTION [5 upvotes]: In an interview I have been asked to solve:
$$\mathbb{E}\left[\left(\dfrac{1}{T}\int^T_0W_tdt\right)^2\right]$$

$\textbf{Attempt:}$
$$
\begin{align}
\mathbb{E}\left[\left(\dfrac{1}{T}\int^T_0W_tdt\right)^2\right] 
&= \dfrac{1}{T^2}\mathbb{E}\left[\left(\int^T_0W_tdt\right)\left(\int^T_0W_udu\right)\right]\\
&= \dfrac{1}{T^2}\mathbb{E}\left[\int^T_0\int^T_0W_tW_udtdu\right]\\
&= \dfrac{1}{T^2}\int^T_0\int^T_0\mathbb{E}\left[W_tW_u\right]dtdu \\
&= \dfrac{1}{T^2}\int^T_0\int^T_0min(u,t)\,dtdu
\end{align}
$$

Then, I couldn't continue. What would be the next steps?

REPLY [5 votes]: Thanks to @dan_fulea hint, here are the next steps to the solution:
$$
\begin{align}
\mathbb{E}\left[\left(\dfrac{1}{T}\int^T_0W_tdt\right)^2\right] &= \dfrac{1}{T^2}\int^T_0\int^T_0min(u,t)\,dtdu \\
&= \dfrac{1}{T^2}\int^T_0\left(\int^u_0min(u,t)\,dt+\int^T_umin(u,t)\,dt\right)du \\
&= \dfrac{1}{T^2}\int^T_0\left(\int^u_0t\,dt+\int^T_uu\,dt\right)du\\
&= \dfrac{1}{T^2}\int^T_0\left(\dfrac{u^2}{2}+u(T-u)\right)du\\
&= \dfrac{1}{T^2}\int^T_0\left(uT-\dfrac{u^2}{2}\right)du\\
&= \dfrac{1}{T^2}\times \left(\dfrac{T^3}{2}-\dfrac{T^3}{6}\right)\\
&= \dfrac{T}{3}
\end{align}
$$