Abstract:A kind of mechanical method for solving differential equations is given. First, a set of differential equation can be written in the form of the Hamilton equations. In particular case, the Hamilton equations possess a canonical form. In general case, they possess a canonical form with nonconservative forces. Secondly, the first integrals of the equations can be obtained by using the Noether theory of the Hamilton system. If all of the integrals can be found, then the solution of the equations will be obtained. Finally, an example is given to illustrate the application of the result.