  It is a classical fact that Wall's index of a triplet of Lagrangians in a
symplectic space over a field $k$ defines a $2$-cocycle $\mu_W$ on the
associated symplectic group with values in the Witt group of $k$. Moreover,
modulo the square of the fundamental ideal this is a trivial $2$-cocycle. In
this work we revisit this fact from the viewpoint of the theory of Sturm
sequences and Sylvester matrices developed by J.~Barge and J.~Lannes in teir
book Suites de Sturm, indice de Maslov et p\'eriodicit\'e de Bott, volume 267
of Progress in Mathematics. Birkh\"auser Verlag, Basel, 2008. We define a
refinement by a factor of $2$ of Wall's cocycle and use the technology of
Sylvester matrices to give an explicit formula for the coboundary associated to
the mod $I^2$ reduction of the cocycle which is valid for any field of
characteristic different from $2$. Finally we explicitly compute the values of
the coboundary on standard elements of the symplectic group.
