You can earn fortune-building returns in the stock market if you can identify powerful, long-term trends -- and the businesses best positioned to profit from them.

The rapid adoption of artificial intelligence (AI) technology is one such trend. Here are two outstanding companies that are poised to capture a sizable share of the AI industry's profit in the coming years.

Amazon.com

Artificial intelligence will be built in the cloud. As the leading provider of cloud infrastructure services, Amazon.com (AMZN 0.67%) is well situated to profit from the AI boom.

In addition to providing the raw computing resources that power a growing number of AI applications, Amazon is striving to become a leader in generative AI. Amazon Web Services (AWS) offers its customers access to powerful tools, such as its Titan foundation models, as well as AI models developed by Anthropic, Stability AI, and other promising machine learning upstarts. Better still, Amazon's highly efficient Trainium and Inferentia chips can help slash the costs of training models and running AI workloads on AWS.

E-commerce remains another potent growth driver for Amazon. Global online retail sales will top $8.1 trillion by 2026, up from $6.3 trillion in 2023, according to Statista. Moreover, Amazon's cost-cutting efforts are helping to boost its operating margin as its sales rise. That's an excellent formula for rapid and sustained earnings growth.

Advertising is another notable opportunity. Third-party sellers pay hefty fees to market their products to the online retail titan's massive customer base. Amazon, in turn, is winning market share in a digital ad industry that's forecast to reach $1.5 trillion by 2030, up from $531 billion in 2022, according to ResearchAndMarkets.

With these powerful trends fueling its growth, Amazon's share price could soar in the years ahead.

Nvidia

Nvidia (NVDA 0.02%) is also a prime beneficiary of the AI megatrend. The semiconductor giant's state-of-the-art chip designs lie at the heart of the computing systems that power many of the leading AI applications.

Nvidia's graphics processing units can be used to train the large language models that underlie popular AI services such as ChatGPT. Demand for these cutting-edge chips is projected to soar to $400 billion by 2027, according to rival chipmaker Advanced Micro Devices. Nvidia commands more than 85% of this booming market, according to analysts at Raymond James.

The impact of this surging demand is transforming Nvidia's financial results. The tech titan's sales climbed 206% year over year to $18.1 billion in the quarter ended Oct. 29. Its adjusted operating profits, in turn, increased a stunning 652% to $11.6 billion.

Yet it's important to note that Nvidia is far more than just an AI growth story. Management sees a $100 billion market for the company's gaming-related chips and a $300 billion opportunity for its autonomous machine technology. All told, the company estimates its total addressable market at a whopping $1 trillion.

Nvidia clearly has plenty of room for further expansion, and Wall Street seems to agree. Analysts expect Nvidia's sales to grow by roughly 119% in 2024 and 57% in 2025 -- and its earnings to increase by over 100% annually over the next half-decade. Buy shares today, and you can position yourself to profit alongside this AI-powered tech titan.