Integration of highly oscillatory functions