The nonhomogeneous differencial equation was investigated by means of a method of the influence function for the problems of nonlinear beam dynamics in the solenoid magnetic field up to the third order. The algorithms within the matrix formalism to obtain the solution of nonlinear equations by the influence function method, are described.