A tried and tested way of making money in the stock market is by buying great companies that are tapping into a growing trend that also trade at attractive valuations and holding them for the long run. This strategy allows investors to benefit from secular growth opportunities and disruptive trends, as well as take advantage of the power of compounding.

Artificial intelligence (AI) is turning out to be one such secular and disruptive trend that has the ability to supercharge the growth of many companies in the long run because of its ability to contribute trillions of dollars to the global economy. There are two companies benefiting big-time from the proliferation of AI. They also happen to be profitable and undervalued when we consider their impressive growth rates. They are Marvell Technology (MRVL 0.41%) and Micron Technology (MU 0.85%).

Let's see why buying and holding these two names for the long run could turn out to be a smart move.

Abstract representation of an AI chip on an integrated circuit.

Image source: Getty Images.

1. Marvell Technology

AI has brought about a major turnaround in Marvell Technology's fortunes. The company, which manufactures application-specific integrated circuits (ASICs) and networking chips, finished fiscal 2025 (which ended on Feb. 1) with revenue growth of just 5% to $5.77 billion. Its generally accepted accounting principles (GAAP) net loss for the year stood at $1.02 per share. The company's tepid performance last year was the result of weakness in multiple end markets such as enterprise networking, carrier infrastructure, and consumer devices.

However, the story has changed remarkably in the first quarter of fiscal 2026. Marvell's revenue for fiscal Q1 (which ended on May 3) shot up a remarkable 63% year over year to $1.89 billion. The company reported a GAAP net income of $0.20 per share as compared to a loss of $0.25 per share in the year-ago period. AI played a central role in driving this terrific turnaround as the demand for Marvell's custom AI processors increased dramatically, leading to a 76% year-over-year increase in its data center revenue to $1.44 billion.

CEO Matt Murphy remarked on Marvell's May earnings conference call, "These strong results, along with our second-quarter guidance, are being driven by the rapid scaling of our custom AI silicon programs to high-volume production, along with robust shipments of our electro-optics products for AI and cloud applications."

Importantly, Marvell expects its robust data center momentum to continue in the current and the next fiscal year, as well as in the long run. The company points out that it is deeply engaged with its AI customers for developing custom chips, and the good part is that they are working with Marvell to develop the next generation of custom AI processors as well.

This explains why the company is confident it can sustain its AI-powered growth in the long run. Moreover, Marvell's focus on pushing the envelope on the product development front is expected to help it land a bigger share of the fast-growing custom AI processor market. The company pointed out last year that its AI-focused addressable market could grow to $75 billion in 2028 from $21 billion in 2023.

It controlled 10% of this market at the end of 2023, according to its own estimates. However, third-party estimates suggest that Marvell's share of custom AI chips increased to 15% last year. Looking ahead, the company is aiming to capture more than 20% of this market.

That could bring its AI revenue to more than $7.5 billion in the next three fiscal years (based on the $75 billion end-market estimate), which would be a major improvement over its fiscal 2025 AI revenue of over $1.5 billion. So, AI is set to move the needle in a big way for Marvell Technology going forward, allowing it to maintain healthy earnings growth levels.

MRVL EPS Estimates for Current Fiscal Year Chart

Data by YCharts.

Marvell stock trades at just 22 times earnings right now. It makes sense to buy this semiconductor stock hand over fist since it is available at a solid discount to the tech-laden Nasdaq-100 index's earnings multiple of 31. The long-term opportunity in the custom AI chip market could help the chipmaker maintain elevated growth levels for a long time to come.

2. Micron Technology

Micron Technology made its name by supplying compute and storage memory chips that are used in computers and smartphones. The company got a serious boost recently from the deployment of some of its products in AI data centers.

The high-bandwidth memory (HBM) manufactured by Micron plays a key role in AI accelerators such as graphics processing units (GPUs) and custom processors as it can transfer data at high speeds while keeping power consumption in check when compared to traditional memory. HBM ensures that a lot of data can be transferred quickly at low latency so that AI workloads can run smoothly.

Not surprisingly, the size of the HBM that's being packed by AI chip designers into their accelerators is increasing. AMD, for instance, has increased the HBM capacity of its latest MI350 series of AI accelerators to 288 gigabytes (GB) from 256 GB on the previous MI325 series processors. The company plans to equip its next generation of MI400 accelerators with a whopping 432 GB of HBM next year.

Even custom AI chip manufacturers such as Marvell and Broadcom are equipping their chips with HBM to speed up AI workloads and improve power efficiency. Not surprisingly, the HBM market's revenue is expected to soar to $86 billion in 2030 from just $1.8 billion in 2023, clocking a compound annual growth rate (CAGR) of 68%.

Meanwhile, the adoption of AI in the smartphone and PC markets is going to be another tailwind for Micron, driving both volume and unit growth for the company. That's because AI-capable smartphones and PCs are equipped with more compute and storage memories, which should expand Micron's addressable market at a nice pace in the future.

The good part is that the AI-driven growth of the memory market has already supercharged Micron's growth. Its revenue in the first six months of the current fiscal year has increased by 59% from the year-ago period. Moreover, Micron has swung to a GAAP profit of $3.08 per share in the first half of the fiscal year from a loss of $0.40 per share in the year-ago period.

Consensus estimates expect Micron to deliver an impressive 439% jump in adjusted earnings this year to $7 per share, followed by a 58% increase next year. Micron stock trades at just 11 times forward earnings right now. So, buying this AI stock looks like a no-brainer as the bright prospects of the memory market could help it sustain healthy earnings growth levels in the long run as well, paving the way for more upside.