The invention provides a method for solving solution of elastic foundation beams and for back analysis of value m, belonging to the technical field of geotechnical engineering. The method comprises the following steps of: 1, firstly, converting a fourth order partial differential equation of the elastic foundation beam into a low order partial differential equation set, and setting iteration times and admissible errors; 1, taking a minimum error function of a displacement value sol.y obtained in the step one and an actually-measured displacement value as an objective function, wherein the minimum error function is the sum of squares of difference values; 3, optimizing the objective function in the second step by the application of MATLAB nonlinear optimization algorithm fmincon functions, when reaching the iteration times or the admissible errors set in the first step, stopping iteration, and in this case, the objective function reaching the minimum value; and 4, the parameters corresponding to the minimum value of the objective function being the optimum solution of horizontal resistance factor value m of the to-be-determined soil layer foundation soil. The method provided by the invention is simple in analysis process and easy for programming.