In this respect, the billions of dollars that have been pouring into tech-driven U.S. businesses has been a very good investment binge, fueling the rise of new methods for extracting oil and gas from shale rock and of the country’s world-leading software and Internet companies.