Consumer and producer are both economic measures of welfare.
The consumer surplus measures the welfare that consumers (people who demand goods) receive when they purchase a good. It is defined as the difference between the consumers willingness to pay (WTP) and the price (P) such that:
Consumer surplus = WTP - P
where willingness to pay defines the maximum value that a consumer is willing to pay for a good or service. For example, if a consumer has a willingness to pay of $10 and pays a price of $4 for a good, then they have a consumer surplus of $6.
The producer surplus measures the welfare that a producer (firms who sell goods) receive when they sell a good. It is defined as the difference between the suppliers willingness to pay (WTS) and the price (P) such that:
Producer surplus = WTS - P
Where willingness to sell defines the minimum that a producer is willing to sell a good or service. For example, if a producer has a good that they're willing to sell for $2, but receives the price $6, then they receive a producer surplus of $4.
The total surplus is the sum of the consumer and producer surplus.
Producer surplus from supply schedule
Consider the following supply schedule and suppose that the equilibrium price was $6. In this case, the supplier will be willing to supply 3 units of output.
For the first unit of output for which the supplier is willing to sell for $2, the producer receives a producer surplus of $4. For the second good which the supplier is willing to sell for $4, the producer receives a producer surplus of $2. The final unit of output the supplier is willing to sell for $6, therefore the producer surplus is $0 for that unit.
The total producer surplus for that producer is the sum of producer surpluses for each unit, such that:
Producer surplus = $4 + 2 = $6.
Calculate producer surplus from supply curve
In the following diagram, the supply schedule above has been converted into a supply curve. Firstly, each point from the supply schedule is drawn with a blue dot. The supply curve is constructed by drawing a straight line through all the points of the supply schedule.
In this example, it is assumed that the price is now $8 per unit and there are 4 producers supplying the goods. To calculate the producer surplus, we could calculate the difference between the price and the willingness to sell for each seller. This is represented by the dotted blue line between the price and the point representing each seller. We can see that the producer surplus is: $6 + $4 + $2.
Alternatively, we can approximate the producer surplus as the area of the red triangle in the following diagram:
It might be worth recalling that the area of the triangle is just half of the length multiplied by the width. The following illustration proves why:
The area of a square equals the length times its width, and two right angle triangles makes one square. Thus, the area is half the length times the width.
Returning to our problem. The producer surplus can be calculated as the read triangle. The length of the vertical side of the triangle is (8 - 2) and the length of the horizontal side is (4-1) giving the approximation of the producer surplus as
It is not quite 12, however, the approximations become more accurate when there are more suppliers than just 3. This process is also a lot simpler than calculating the individual producer surplus for each seller and then summing the total when there are a large amount of suppliers.