There is something called productive consumption. The coal and the iron a steelmill consumes are productive consumption, as steel cannot be produced without consumption of coal and iron.
Plus, the bread and cloth workers for the steelmill consume are also productive consumption, as the workers would not be able to work without eating and dressing.
Consequently, taxing the consumption of coal, iron, cloth, and bread, is to tax investment - the investment the steelmill makes in buying iron and coal, and in paying wages to its workers.
Evidently, not all products have such characteristic. But the products the consumption of which is not productive consumption are those more likely to be bought with dividends. As such, dividends are not investment (though obviously they can be invested once they have been distributed). On the contrary, they are divestment: money taken away from the company's productive processes.
I am not sure of what you mean by "I mean taxing dividends and capital gains". If this means you are equating "dividends and capital gains" with "investment", then it seems to me you are mistaken; low taxes on dividends favour lazy behaviour of capitalists, low rates of investment, and even lower rates of innovation. If you mean the opposite, ie, that government should tax dividends instead of the money that is invested in the company, then yes, the functioning of a capitalist economy would benefit from such a policy - up to the point when it is already at full employment; at that point, it would probably provoke overinvestment, multiplication of bottlenecks, increase of inefficiency, and, at the limit, political unrest and upper class opposition to the policy itself.