I'm having trouble with determining the potential energy of the mass-spring system depicted below. We assume that the extensions of all 3 springs are zero when $x_1=x_2=0$. The potential energy that I obtained is apparently incorrect. Here is what I've done:
$$U = \frac{1}{2}kx_1^2 + \frac{1}{2}kx_2^2 + \frac{1}{2}k(x_1+x_2)^2 = k(x_1^2+x_1x_2+x_2^2),$$ where I've considered each spring's potential energy separately. The mark scheme's version for $U$ is this:
$k(x_1^2-x_1x_2+x_2^2)$, so I suppose for them, the PE for the middle spring is $U_{mid} = \frac{1}{2}k(x_1-x_2)^2 = \frac{1}{2}k(x_2-x_1)^2$. So my guess is that they've assumed that $x_1$ is negative? Is this the source of the discrepancy?