This paper presents an inverse problem in analytical dynamics.The inverse problem is to construct the Lagrangian when the integrals of a system are given.Firstly,the differential equations are obtained by using the time derivative of the integrals.Secondly,the differential equations can be written in the Lagrange equations under certain conditions and the Lagrangian can be obtained.Finally,two examples are given to illustrate the application of the result.