Incidence of Taxation
When tax is imposed, it causes the supply curve to shift to the left.
When demand is more elastic(shallower demand curve), rise in price due to taxation will have a larger effect on quantity demanded, therefore, producers will have to bear a greater burden of tax.
On the other hand, when the demand curve is steeper(inelastic demand), the burden of tax born by the consumers will be greater.
Incidence of a Subsidy
A subsidy will increase supply and therefore shift the supply curve to the right. The benefit of the tax will be enjoyed by both the consumers and producers. Consumers get the benefit in terms of reduced prices. Producers get the benefit in the form of reduced costs.