Let $X_1,X_2,\dots,X_n$ be independent random variables such that $\mathbf{E}(X_i)=0,\mathbf{E}(X_i^2)\leq 1$ for $1\le i\le n$ then show that $$\mathbf{E}\left(\max_{1\le i\le > n}(X_1+X_2+\dots+X_i)^2\right)\leq \dfrac{n(n+1)}{2}$$
Now what I did was, the maximum would be some $(X_1+X_2+\dots+X_j)^2$ so we need to compute $$\mathbf{E}((X_1+\dots+X_j)^2)=\sum\mathbf{E}(X_i)^2+\sum\mathbf{E}(X_kX_\ell)=\sum_{i=1}^{j}\mathbf{E}(X_i^2)\le j$$ because $\mathbf{E}(X_kX_\ell)=\mathbf{E}(X_k)\mathbf{E}(X_\ell)=0$ is due to independence. But then $$\mathbf{E}\left(\max_{1\le i\le n}(X_1+X_2+\dots+X_i)^2\right)\le \max_{1\le j\le n}j=n$$ Which reduces the bound considerably. So, I am a bit worried this proof is flawed, can someone check it? Thanks a lot.