Buying and holding solid tech companies for the long run is a tried and tested way of creating wealth, as such a strategy allows investors to benefit from fast-growing technology trends that could shape our future.

For instance, an investment of $5,000 in Nvidia or Netflix a decade ago would be worth $341,500 and $108,500, respectively, right now as these tech stocks have shot up 6,830% and 2,170%, respectively, in the past 10 years. Both companies have benefited from secular trends in their industries, with Nvidia taking advantage of the growing need for computing power and Netflix riding the growth of the video streaming industry.

Similarly, the likes of Applied Materials (AMAT 0.73%) and Palo Alto Networks (PANW -1.71%) have delivered terrific returns to investors in the past decade, tapping the growth of the cybersecurity and semiconductor markets, respectively.

AMAT Chart

AMAT data by YCharts

Both of these stocks could replicate their terrific performances in the future. Let's look at the reasons why investors might want to consider putting $5,000 into stock from either Applied Materials or Palo Alto Networks for the long run. 

Two people looking at a laptop.

Image source: Getty Images.

1. Applied Materials

The semiconductor industry has recorded terrific growth in the past decade. According to a third-party estimate, nearly $51 billion worth of semiconductors were sold in December 2021 -- a huge jump compared to $23 billion in monthly semiconductor sales in January 2012.

The global semiconductor industry looks primed for further growth as the application of chips is growing in multiple verticals such as automotive, data centers, smartphones, and factories, among others. Semiconductor industry association SEMI estimates that the industry could clock $1.3 trillion in annual revenue by 2030, which would be more than double last year's sales of $583.5 billion.

Not surprisingly, chipmakers across the globe are busy ramping up their production capacities. SEMI estimates that at least 86 semiconductor fabrication plants are set to come online between 2020 and 2024. As a result, global fab equipment spending is expected to hit $107 billion this year, up 18% over 2021, and record another $100 billion-plus year in 2023. The rapid growth in semiconductor capital spending explains why Applied Materials has been growing at a terrific pace.

AMAT Revenue (TTM) Chart

AMAT Revenue (TTM) data by YCharts

Applied Materials supplies semiconductor manufacturing equipment to foundries, which then use its equipment to fabricate chips. The company's revenue was up 34% in fiscal 2021 (ended Oct. 31, 2021) to a record $23 billion, while earnings had jumped 64% to $6.84 per share. It is also worth noting that Applied Materials' order book is filling up at a nice pace. The company had $8 billion worth of order backlog at the end of the first quarter of fiscal 2022 (ended Jan. 30) and it expects to carry a substantial backlog into fiscal 2023 as well -- which isn't surprising.

Applied Materials gets 35% of its revenue by selling semiconductor manufacturing equipment to Samsung and Taiwan Semiconductor Manufacturing, popularly known as TSMC, while Intel is another key customer. All these companies are planning to invest substantially in upgrading their capacities. TSMC, for instance, plans to spend $100 billion over the next three years to increase production, while Intel has outlined $27 billion in capital spending for 2022 -- a number that's likely to increase for the next couple of years. Bain analyst Peter Hanbury estimates semiconductor industry capital expenditures are likely to double over the five years spanning 2021 to 2025 as compared to 2016 to 2020.

All this indicates Applied Materials can sustain its impressive growth in the future. And, with the stock trading at just 17 times trailing earnings as compared to the S&P 500's multiple of 25, now looks like a good time to buy this semiconductor stock.

2. Palo Alto Networks

Palo Alto Networks stock has defied the tech sell-off of 2022, with its shares gaining nearly 11% this year as compared to the Nasdaq-100 Technology Sector index's decline of 16%. This is despite the stock's rich valuation as it trades at 12.5 times sales and 70 times forward earnings, way higher than the S&P 500's sales multiple of 3 and forward earnings multiple of 20.

Palo Alto's resilient performance can be attributed to its solid results for the fiscal 2022 second quarter, which ended Jan. 31. Its revenue increased 30% year over year and the cybersecurity specialist also raised its full-year guidance. Palo Alto's key metrics -- such as remaining performance obligations that measure the total value of customer contracts for which services are yet to be provided -- indicate that the company is about to switch into a higher gear.

There was a 36% increase in Palo Alto's remaining performance obligations last quarter to $6.3 billion, which exceeds the company's full-year revenue guidance of $5.45 billion. What's more, Palo Alto is expected to sustain this impressive growth momentum, with analysts expecting a sharp increase in revenue for the next couple of years. The five-year annual earnings growth forecast of 25% is also healthy.

PANW Revenue Estimates for Current Fiscal Year Chart

PANW Revenue Estimates for Current Fiscal Year data by YCharts

It is not surprising to see Palo Alto is expected to log impressive growth in the coming years. The company has grown to become the top vendor of cybersecurity appliances, controlling nearly 19% of this market last year and leaving the likes of Cisco Systems behind. That's a big jump as Palo Alto held just 3.6% of this space at the end of 2012.

So, Palo Alto is in a solid position to tap into the massive cybersecurity market that's expected to almost triple in size by 2030 and generate $540 billion in revenue as compared to $183 billion in 2020, according to third-party estimates. This massive secular growth opportunity combined with Palo Alto's robust share explains why its revenue and earnings are expected to clock impressive growth in the future, making it a top cybersecurity stock to buy right now, since it could continue justifying its rich valuation.