Consumer surplus is the value consumers get in excess of what they pay; producer surplus is the revenue firms receive in excess of production cost. Together they measure total surplus (social welfare). Deadweight loss (DWL) is the loss of total surplus from deviations from competitive equilibrium—from taxes, price controls, monopoly power, or externalities. Comparing surpluses before and after a policy reveals its welfare impact.
Draw supply-demand graph. Shade consumer and producer surplus at equilibrium. Then introduce a tax or price control, show how surpluses shrink and DWL appears. Calculate magnitudes.
From your prerequisite on consumer surplus, you know that consumer surplus (CS) is the area between the demand curve and the market price — the aggregate "deal" buyers get. Producer surplus (PS) is the symmetric concept for sellers: the area between the supply curve and the market price, representing revenue above the minimum sellers would have accepted. When you add them together you get total surplus, which economists use as a measure of how much value a market generates for society as a whole. At the competitive equilibrium, total surplus is maximized — the demand and supply curves cross exactly where the last unit traded is worth just what it costs to produce.
Now introduce any policy that shifts the effective price away from equilibrium. A price ceiling set below the equilibrium price (like rent control) lowers the price paid by consumers who can still buy, but it also reduces quantity exchanged — some mutually beneficial trades no longer happen. The surplus those trades would have generated simply disappears; it is not transferred to anyone. This lost surplus is the deadweight loss (DWL): a triangle on the supply-demand diagram between the old quantity and the new quantity, bounded by the demand curve above and the supply curve below. The same geometry arises from a price floor, an excise tax, a monopolist restricting output, or an externality causing overproduction.
An excise tax is the clearest case to work through. The tax drives a wedge between the price buyers pay and the price sellers receive. Buyers pay more, so CS shrinks. Sellers receive less, so PS shrinks. The government collects tax revenue equal to the tax rate times the quantity traded — this revenue is a transfer, not a loss. The DWL is the triangular area corresponding to the transactions that no longer occur because the buyer's willingness to pay falls short of the seller's minimum acceptable price once the tax wedge is inserted. The size of DWL depends critically on elasticities: more elastic supply or demand means quantity falls more for a given tax, producing a larger triangle.
Welfare analysis is fundamentally comparative: you compute total surplus (or its components) before and after the policy change and assess who wins, who loses, and whether any net gains or losses emerge. This framework is powerful precisely because it is consistent — the same geometry applies to taxes, subsidies, quotas, price controls, and market power. A subsidy moves in the opposite direction from a tax: it pushes quantity above the efficient level, generating a DWL on the surplus-*exceeding* side. The key insight is that DWL is not a normative verdict. A society may rationally accept DWL from a tax if the public goods financed by the revenue produce benefits that exceed the welfare triangle. The triangle measures cost, not the full cost-benefit picture.