the free density matrix for a particle in a box
adding various geometric series in cos squared