I wonder if the 40 billions includes the capital gain from the company stock held by Apple itself. Lets consider 40% margin of $500 iPad for example, 40 billions profit means Apple has to sell 200 million units to the market in a year, which is definitely not possible at the moment. As iPad and iPhone should contribute the most profit now, Apple sales record did not reflect they have sold that number of units. Other income from Mac, iPod, or the iTunes stores, or even lawsuit win and loyalty are also unlikely to make up the differences. But if you take into account the appreciation of share price from a year ago, yeah that might be possible.
However, if the share price goes down, there could be big decrease in profit as well. Or maybe Apple is also playing the stock market at the moment to earn extra income.
Someone should really take a look at the P&L statement from Apple to see where those profit come from.