State observers for nonlinear systems with slowly varying inputs