Conditional Integral of Square of Brownian Motion? I am struggling to compute the expectation and variance of the following, where $W(s)$ is a standard Brownian motion:
$$ X := \int_{0}^{A}W(s)^2ds$$
$$ Y:= \int_0^AW(s)ds $$
$$E[X\mid Y] = \space ?$$
$$Var[X\mid Y] = \space ?$$
 A: Note that, for every $s$ in $(0,A)$, $(W(s),Y)$ is a centered gaussian vector hence there exists some real numbers $(u(s),v(s))$ and some standard normal random variable $Z(s)$ independent of $Y$ such that $$W(s)=u(s)Y+v(s)Z(s).$$ Thus, $$X=\int_0^A(u(s)Y+v(s)Z(s))^2\mathrm ds=aY^2+2VY+T$$ where $$a=\int_0^Au(s)^2\mathrm ds,\quad V=\int_0^Au(s)v(s)Z(s)\mathrm ds,\quad T=\int_0^Av(s)^2Z(s)^2\mathrm ds.$$ Since $V$ and $T$ are independent of $Y$, this yields $$E(X\mid Y)=aY^2+E(T)=Y^2\int_0^Au(s)^2\mathrm ds+\int_0^Av(s)^2\mathrm ds.$$ Likewise, $$\mathrm{var}(X\mid Y)=\mathrm{var}(2VY+T\mid Y)=4E(V^2)Y^2+\mathrm{var}(T).$$
We now indicate how to compute $a$, $E(T)$, $E(V^2)$ and $E(T^2)$. First, the decomposition of $W(s)$ into a linear combination of $Y$ and $Z(s)$ independent of $Y$ yields $$E(W(s)Y)=u(s)E(Y^2),\qquad E(W(s)^2)=u(s)^2E(Y^2)+v(s)^2.$$ Since $E(W(s)Y)=s(A-s/2)$ and $E(Y^2)=A^3/3$, this yields $u(s)$ and $v(s)$, hence the values of $a$ and $$E(T)=\int_0^Av(s)^2\mathrm ds,$$ which might be $$a=\frac65\frac1A,\qquad E(T)=\frac1{10}A^2.$$ To compute $E(V^2)$ and $E(T^2)$, it might be better to start from $$V=\int_0^Au(s)(W(s)-u(s)Y)\mathrm ds,\quad T=\int_0^A(W(s)-u(z)Y)^2\mathrm ds,$$ hence $$E(V^2)=2\int_0^Au(s)\int_0^su(t)E((W(s)-u(s)Y)(W(t)-u(t)Y))\mathrm dt\mathrm ds,$$ which yields $$E(V^2)=2\int_0^Au(s)\int_0^su(t)(t-u(s)u(t)E(Y^2))\mathrm dt\mathrm ds,$$ from which the value of $E(V^2)$ follows. Likewise for $E(T^2)$, which requires $E(Y^4)=3E(Y^2)^2$.
