Piecewise polynomials and the partition method for nonlinear ordinary differential equations