Invest more?
Microsoft already invests a hell of a lot in R&D. The problem isn't lack of spending, it is that they develop the wrong products, or poor products, or both. Since Windows/Office sales are showing they've peaked, investors are rightly worried that profit from the new stuff is not going to be able to make up for the declining profit from the old stuff.
Apple spent a fraction of Microsoft's R&D budget in the years they were developing the iPhone and iPad. Spending bucketloads of cash on R&D is no better than spending nothing on it if you the same outcome either way.
Given Microsoft has lost billions in all non Windows/Office endeavors when you combine them all over the past two decades, they would have been better off if they'd done nothing (of course investors would have punished them far more for not even trying)