A nonlinear ordinary differential equation associated with the quantum sojourn time