Let $(X_i)_i$ be independent random variables such that $X_i \sim U[0, 1]$, and define $Y_i = X_i X_{i+1}$ and $Z_n = \sum_{i=1}^n Y_i$.
I want to find the variance of $Z_n$.
I found that $\mathbb E [Z_n]=\frac{n}{4}$ , and when applying the formula of the variance, I have $\sum_{i=1}^n \operatorname{Var}(Y_i) = \frac{7n}{144}$ using the fact the $X_i$'s are independent.
How do I find the covariance of the other variables?
$$\text{Var}\left(\sum_{i=1}^n Y_i \right) = \sum_{i=1}^n \sum_{j=1}^n \text{Cov}(Y_i, Y_j)$$
Now if $|i-j|\ge 2$, $Y_i = X_i X_{i+1}$ and $Y_j = X_j X_{j+1}$ are independent, so these covariances are $0$.
If $i=j$, $$\text{Cov}(Y_i, Y_i) = \text{Var}(X_i X_{i+1}) = \mathbb E[X_i^2 X_{i+1}^2] - \mathbb E[X_i X_{i+1}]^2 = \mathbb E[X_i^2]^2 - \mathbb E[X_i]^4 =\frac{7}{144}$$ There are $n$ of these terms, contributing a total of $7n/144$ to the variance of $Z_n$.
If $i=j\pm 1$, $$\eqalign{\text{Cov}(Y_i,Y_j) &= \text{Cov}(X_{j+1} X_{j+2},X_{j} X_{j+1}) = \mathbb E[X_j X_{j+1}^2 X_{j+2}] - E[X_j X_{j+1}]^2 \cr &= \mathbb E[X_j]^2 \mathbb E[X_j^2] - \mathbb E[X_j]^4 = \frac{1}{48} }$$
There are $2n-2$ of these terms, contributing a total of $(2n-2)/48$. Thus $$ \text{Var}(Z_n) = \frac{7n}{144} + \frac{2n-2}{48} = \frac{13 n}{144} - \frac{1}{24} $$