Abstract In this study, a reproducing kernel method based on shifted Legendre polynomials is proposed for obtaining numerical solutions to the nonlinear Duffing equation involving both integral and non-integral forcing terms subject to three types of boundary conditions. Unlike the classical reproducing kernel method, the proposed method employs Legendre polynomials to construct the reproducing kernel function. Furthermore, instead of homogenising the boundary conditions, the method incorporates
