Now let's talk about some of the effects on the market when there's a tax imposed. So the first thing we're going to see is that when there's a tax imposed, there's going to be tax revenue, right? The government is going to collect some amount of tax revenue. And we're going to be able to calculate that pretty easily, right? Because we're talking about per unit taxes, right? So for each unit that's sold, there's going to be a tax. So we're going to calculate our tax revenue as follows: the amount of the tax, which is the per unit tax, times the quantity exchanged at the taxable rate, represented as QT.
The tax revenue is going to be represented by a rectangle on the graph; this rectangle represents the tax and this represents the quantity where this is QT, the quantity with the tax. So, the calculation of tax revenue is going to be the amount of the tax times the quantity that is actually exchanged. You'll notice here, right, when we have this tax, we're not in equilibrium, right? The equilibrium was right here, and that's where we want to be, but now we have the situation where the price the buyer pays and the price the seller receives are different. We're not in equilibrium and there are trades that are not occurring because we're not at that equilibrium price. So, when the market is not in equilibrium, we lose some of our economic surplus. Remember economic surplus? That was the total of our consumer surplus and our producer surplus. We're going to see actually another part of surplus in this example. But when we lose economic surplus, we create what's called a deadweight loss.
Now, without a tax, when we're at equilibrium, the consumer surplus is going to be everything above the price but below the demand curve, which would include all of this area A, B, and C in our consumer surplus. For the producer surplus, it's going to be everything below the price and above the supply curve, which includes the areas D, E, and F. In this case, there's no tax, so there's no tax revenue. Our economic surplus is the sum of all of this which is A + B + C + D + E + F, and at equilibrium, we're maximizing that surplus.
With a tax, the situation changes. The consumer surplus is reduced to just area A, losing areas B + C due to the tax. Producer surplus is reduced to just F, losing D + E. The tax revenue, represented by the rectangle of area B + D, transfers part of the surplus from consumers and producers to the government. So, we calculate the economic surplus to include the tax revenue as well. Now it includes the areas A + B + D + F, losing C and E from our economic surplus. Lastly, the deadweight loss, which did not exist without a tax, is now represented by areas C + E, which indicates the surplus lost due to the tax impacting trading activities, preventing achieving the optimal trading quantity Q*.