Amazon's (AMZN -0.17%) stock surged after it reported second-quarter earnings following the market close on July 28. That said, it was more of a relief rally as the results were better than feared. Market participants had been concerned about the alarming rate of increases of Amazon's expenses.

At the pandemic's onset, hundreds of millions of folks looked to the e-commerce retailer to help them get the goods they needed without leaving their homes. Amazon invested in expanding its capacity to deal with the surge of new customers and orders. However, now that economies are reopening, folks are returning to brick-and-mortar stores for more of their needs, decelerating revenue growth at Amazon. Meanwhile, the investments in capacity are longer lasting.

Let's examine Amazon's rising costs and determine if they are enough reason to sell the stock right now. 

Amazon can grow out of its expense problem 

In the most recent quarter, which ended on June 30, Amazon's total operating expenses rose to $117.9 billion. That was up from $105.4 billion in the same quarter of the prior year. Interestingly, while total costs increased by $12.5 billion year over year, net sales increased by just $8.2 billion. In other words, Amazon's expenses outpaced sales by more than $4 billion.

AMZN Operating Income (Quarterly) Chart

AMZN Operating Income (Quarterly) data by YCharts

Of course, Amazon has noticed the trend and is working on bringing it into better balance. The company is not investing in any new capacity, so it will mitigate the cost pressure if it can sustain revenue growth. That's because its costs will remain relatively flat while revenue expands. This is one of the reasons investors cheered the results from Q2.

The earnings release on July 28 included management's forecast for Q3, which predicted revenue growth between 13% and 17% for Q3. If it hits that target, it would be a meaningful acceleration from the slower 7% growth rate in both Q1 and Q2.

CFO Brian Olsavsky said in the company's conference call that followed the Q2 earnings release: "We expect fixed cost leverage to improve in the second half of the year as we continue to grow into our capacity. We have also taken steps to slow future network capacity additions." Sequential improvements were already made between the first and second quarters, where incremental costs of $6 billion in Q1 were lowered to $4 billion in Q2.

AMZN Revenue (Annual YoY Growth) Chart

AMZN Revenue (Annual YoY Growth) data by YCharts

Since Amazon has increased revenue at a compound annual growth rate of 25.6% over the last decade, it would be reasonable to assume it will return to higher rates following this near-term slowdown. After all, consumers are unleashing pent-up demand to dine at restaurants, travel, concerts, and other away-from-home experiences they missed out on for better than two years. That's leaving fewer dollars to spend shopping online.

This is no time to bail on Amazon's stock

AMZN PE Ratio Chart

AMZN PE Ratio data by YCharts

Moreover, the market has been worried about Amazon's prospects for over a year. The stock is trading at a price-to-earnings of 65, near the lowest it has sold for in the previous five years. While Amazon's expense growth is concerning, it is no reason to sell Amazon's stock now.