The existence and properties of the solution of a class of nonlinear differential equations with switching at variable times