For the world's largest integrated oil companies, times have been better. Lackluster share-price performance aside, the majors' second-quarter earnings were quite disappointing across the board. Most found it difficult to grow production, despite shelling out record amounts of money.

The problem has been especially severe for Royal Dutch Shell (RDS.A), one of the group's biggest spenders. Let's take a closer look at the company's capital spending program and whether or not it will pay off in the long run.

Progress in reducing expenses
One of the main concerns among investors is Shell's gargantuan capital-spending program, to which there seems to be no end in sight. Investors had assumed that the company's capex would at least level off after several years of heavy spending on megaprojects.

But that doesn't seem to be the case. This year, Shell expects to spend $33 billion in net capital investment, a 10% increase over 2012 spending levels. And in the four years from 2012 to 2015, the company plans to spend about $130 billion, roughly 20% more than it spent from 2008 to 2011.

Meanwhile, Shell's main European competitor, Total (TTE 1.39%), recently revealed that its capital spending will actually decline to $24-$25 billion in the period 2015-2017, down from between $28 billion to $29 billion this year, while ExxonMobil (XOM 0.23%), the largest publicly traded energy company in the world, plans to increase its spending by a much more moderate amount -- about $1 billion annually -- over the next five years.

Shell's capital spending: a mixed bag
Yet despite all this spending, some of Shell's most capital-intensive projects have failed to pay off. Consider its operations in Nigeria, for instance, which have been beset by oil theft and vandalism that resulted in the loss of some 100,000 barrels of production per day in the second quarter, and its $5 billion oil campaign in Alaska, which has failed to produce any oil so far and was shelved  recently due to regulatory and environmental uncertainties.

And then there's Shell's North American oil and gas production business, which swung to a loss last year and is expected to remain in the red for the remainder of this year and possibly longer. As a result, the company took a $2.1 billion impairment charge against the value of its liquids-rich North American shale portfolio in the second quarter.

On the other hand, a few of Shell's big-ticket investments, including its various LNG projects around the world, its ventures in the Canadian oil sands, and its $19 billion Pearl gas-to-liquids project in Qatar are paying off handsomely.

In fact, Shell's earnings from its integrated-gas division, which includes its various LNG business as well as Pearl, have almost quadrupled over the past five years and now represent more than a third of its earnings. As a result, Shell projects  its cash flow in the period 2012-2015 to be 30%-50% higher than in the 2008 to 2011 period.

The bottom line
While investors are rightly concerned about Shell's capital-spending program over the next few years, I think the company's decision to invest "throughout the cycle" will ultimately pay off. I think the most important thing to remember here is that Shell looks at its investments over a much longer time horizon than most oil and gas companies.

Consider its investments in LNG, for instance. The company has already spent more than $40 billion on LNG projects and has several others that are either operational or under construction in seven countries around the world. While these projects require heavy up-front capital spending, they also feature highly stable revenue streams since most of their production is secured by long-term contracts.

As such, they should continue to generate strong and reliable cash flows for decades into the future, allowing the company to focus on returning more cash to shareholders through dividends and share buybacks.