Share prices of Applied Materials (AMAT 4.28%) have jumped close to 30% since the beginning of July thanks to the rally in semiconductor stocks, which may seem a tad surprising given some troubling forecasts from some of the industry's bellwethers such as Nvidia and Intel.

The slowing demand for personal computers, graphics cards, and smartphones doesn't bode well for the semiconductor industry in general and Applied Materials in particular. That's because the weakness in these industries could reduce the need for Applied Materials' semiconductor fabrication equipment. But Applied Materials' rally indicates that investors are upbeat about the company's prospects despite the shaky end-market environment.

A closer look at the developments in the semiconductor industry will tell us why that may be the case.

Semiconductor capital spending is still healthy

Semiconductor industry association SEMI released its mid-year forecast on July 12. The association expects chipmakers to spend a record $117.5 billion on manufacturing equipment this year, an increase of 14.7% over last year. More importantly, semiconductor equipment spending is expected to remain healthy in 2023 as well, hitting $120.8 billion.

One may wonder why chip foundries will spend more money on equipment at a time when there seems to be a slowdown in demand. That's because foundries are still witnessing a healthy demand for chips. Taiwan Semiconductor Manufacturing (TSM 4.07%), popularly known as TSMC, raised its sales forecast for 2022 last month.

TSMC is the world's largest semiconductor foundry. The company says that even though sales of smartphone chips grew at a slow pace in the second quarter, the demand for chips from data centers, the Internet of Things, and the automotive segments continues to remain robust. In simpler words, even if there is weak demand for semiconductors from certain niches, there are other areas to offset that weakness.

This explains why TSMC's revenue for the month of July, which was the first month of the third quarter, increased nearly 50% year over year. More importantly, TSMC still plans to spend over $40 billion in capital expenditure this year, focusing on advanced manufacturing nodes that are in solid demand as they pack more computing power and are more energy-efficient. For comparison, TSMC's capital spending stood at $30 billion in 2021.

TSMC produced 15% of Applied Materials' top line last year, so the Taiwanese foundry's increased capital spending budget bodes well for the latter.

Moreover, the shortage of components has also weighed on semiconductor equipment providers such as Applied Materials. The company had a record backlog of $8 billion at the beginning of the year, driven by solid order growth that has continued since. So, a slowdown in the demand for chips from the PC and the smartphone markets could be a blessing in disguise for Applied Materials as it may be able to get its hands on more components that could improve its ability to fulfill orders.

Applied Materials stock is an attractive buy right now

Applied Materials is trading at less than 15 times trailing earnings. That's lower than the S&P 500's earnings multiple of nearly 23.

Buying Applied Materials at this discounted valuation looks like a good idea as it is expected to clock nearly 14% annual earnings growth for the next five years. What's more, Applied Materials also pays a small dividend with a forward yield of 1%. The company has increased its dividend for five years on the trot, a streak that it could sustain in the future thanks to a conservative payout ratio and its ability to clock consistent earnings growth.

As such, investors looking to buy a semiconductor stock that could deliver a mix of price upside and a steady stream of dividend income should take a closer look at Applied Materials before it flies higher.