Several Wall Street firms are exceedingly bullish on artificial intelligence (AI). Goldman Sachs recently said the S&P 500 was undervalued due to the AI boom. Meanwhile, Bank of America, BMO Capital Markets, and RBC Capital have all referenced AI when increasing their year-end forecasts for the benchmark index.

Last week, consultancy Capital Economics came out with the most bullish call to date. The firm raised its 2025 price target for the S&P 500 to 6,500. That implies 50% upside from its current level, or returns of 17.6% annually over the next two-and-a-half years, which is well above the long-term average.

The frenzy surrounding AI has been a long time coming. But OpenAI provided the spark when it launch its viral application ChatGPT in November, and Nvidia fanned the flames when it reported better-than-expected results last quarter and guided for record revenue in the current quarter.

How to invest in artificial intelligence

Ark Invest says revenue from AI software could increase at 42% annually to reach $14 trillion by 2030. Investors looking to capitalize on that monumental opportunity have many options at their disposal. Countless companies will benefit from that rising tide, but Amazon (AMZN 1.10%) and Datadog (DDOG -1.52%) look particularly attractive at their current prices.

The bull case for Amazon: Amazon runs the most popular e-commerce marketplace in the world, and it accounted for 38% of online retail sales in North America and Western Europe last year. But the company has achieved similar success in cloud computing. Amazon Web Services (AWS) offers a broader and deeper suite of infrastructure and platform services than any other vendor, and it holds about twice as much market share as its closest competitor.

That success reflects strength in multiple cloud verticals, including AI and machine learning (ML). Research company Gartner recently recognized AWS as a leader in cloud AI developer services, and the company allegedly has a more comprehensive arsenal of AI and ML products than any other vendor. But AWS recently branched into generative AI with the launch of Amazon Bedrock and Amazon CodeWhisperer.

Bedrock provides access to pre-trained models that help clients build generative AI applications, and CodeWhisperer accelerates software development by leaning on generative AI to write code. Those products should help the company cash in on growing demand for AI software. And with shares of Amazon trading at 2.5 times sales, a discount to the three-year average of 3.4 times sales, now is an excellent time to buy this AI growth stock.

The bull case for Datadog: Datadog provides observability and security software that helps organizations keep their IT environments performant. Its platform brings together a broad range of monitoring capabilities that provide real-time visibility across corporate applications, networks, databases, and devices, and it leans on AI to automate tasks like anomaly detection and root cause analysis.

Datadog has achieved a strong presence in several observability software verticals. Gartner recently recognized the company as a leader in application performance monitoring, citing its broad product portfolio and sophisticated AI-powered analytics capabilities as key strengths. And Forrester Research recently recognized Datadog as a leader in AI for IT operations, citing the extensive number of data scientists employed by the company as a key advantage.

Organizations depend on an ever-growing number of software products and cloud services, and those technologies are often spread across private data centers and public clouds. In short, digital transformation is making IT environments more complex, and that should drive demand for observability and security software much higher in the years ahead. Indeed, Datadog says its total addressable market will climb from $41 billion in 2022 to $62 billion by 2026.

In spite of that monumental opportunity, shares currently trade at 17 times sales, an absolute bargain compared to the three-year average of 37.5 times sales. That's why investors should consider buying a small position in this growth stock today.

Another way to invest in artificial intelligence

As discussed, several financial institutions on Wall Street think the S&P 500 is undervalued due to potential upside surrounding AI, and Capital Economics says the AI boom could drive the index 50% higher by the end of 2025. One of the easiest ways to capitalize on that momentum is to buy an S&P 500 index fund like the Vanguard S&P 500 ETF (VOO -0.17%).

S&P 500 index funds provide exposure to hundreds of blue chip American businesses that span all 11 stock market sectors. Put another way, they allow investors to spread capital across some of the most influential companies in the world, many of which are incorporating AI into their businesses.