Piecewise series solutions to ODEs