Businesses are rapidly investing in artificial intelligence (AI) to improve productivity and create new applications for both consumer and enterprise use. This will be a monster growth opportunity over the next decade, so investors who identify the companies best positioned to capitalize could reap big rewards.

Here are two companies working on AI that could be rewarding long-term investments.

1. Palantir Technologies

Organizations from the military to Fortune 500 companies are using software from Palantir Technologies (PLTR 4.65%) for data analytics powered by AI. The stock has been volatile over the past few years, but it's up about 230% since bottoming out in 2022.

As the stock's recent returns suggest, Palantir's business is delivering solid financial results. Its quarterly revenue of $634 million tripled over the last five years. The company posted revenue growth of 21% year over year in the first quarter, driven by a 69% year-over-year increase in customer count. The faster growth in customer count shows an opportunity to deliver more growth as those customers expand their relationships with Palantir.

While the company's U.S. government revenue grew just 12% year over year in Q1, business from U.S. companies is booming. U.S. commercial revenue grew 40% year over year last quarter. In 2023, Dresner Advisory Services selected Palantir as a top supplier in AI, data science, and machine learning -- a recognition well reflected in the company's financials.

One of its customers is home improvement retailer Lowe's, which is using Palantir's software platform to improve customer service. Another notable customer is Archer Aviation, which is using it for dynamic flight routing and predictive maintenance. Those are just a few examples of how companies use Palantir.

One important quality an investor should look for in any software company is whether it is successfully converting growing revenue into profits. Palantir checks this box, as management anticipates adjusted operating income reaching between $868 million and $880 million this year on more than $2.6 billion of revenue. Profitable growth is what will deliver meaningful returns to investors, and Palantir is clearly showing it can achieve that.

2. Tesla

It's been a tough year for the electric vehicle (EV) market, with sales pressured by rising interest rates and competition among leading EV makers. Tesla (TSLA 0.54%) reported a dip in revenue in the first quarter, which has weighed on the stock's performance year to date. But while Tesla is mostly known as an EV brand and still has plenty of upside in that market, its investments in AI and software are where the company is separating itself in the auto industry.

CEO Elon Musk mentioned on a recent earnings call that Tesla was in conversations with a major automaker about potentially licensing its full self-driving (FSD) software. Considering that an estimated 29% to 54% of new vehicles could be electric by 2050, according to the Institute for Energy Research, Tesla could be looking at a sizable opportunity from licensing its self-driving software.

Tesla is already one of the most profitable auto makers in the world, generating $13 billion in net profit over the last year. One of things it can do with those profits is buy Nvidia's costly chips for AI training. It's making significant progress training its AI models. Recent video reviews show Tesla's latest version of FSD handling typical traffic and road challenges about as well as a human driver.

The improvement with Tesla's FSD tees up the company for its highly anticipated unveiling of the Cybercab in August. The robotaxi market is expected to grow rapidly over the next decade, from $400 million in 2023 to over $45 billion by 2030, according to MarketsandMarkets, and Tesla could be the leading supplier one day.

All said, Tesla's investments in AI, including work on humanoid robots, could lead to more revenue opportunities over time that are not baked into the stock's valuation.