The trace formula for Schrödinger operators on the line