Integration of nonintegrable systems