Assessment of two analytical methods in solving the linear and nonlinear elastic beam deformation problems