Solution (source code)

= Solution

The <density> is symmetric about $L/2$: $p(L-x)=p(x)$. Denote the <expectation> by $\mu=\int_0^Lxp(x)\,dx$. Substitution $u=L-x$ gives
$$
\mu=\int_0^L(L-u)p(u)\,du=L\int_0^Lp(u)\,du-\mu=L-\mu.
$$
Thus \b[$\langle x\rangle=L/2$]. An <expectation> need not coincide with a high-density position: the centre is a node of this particular state, but the two equally weighted lobes balance about it.