An externality arises when a firm or person engages in an activity that affects the wellbeing of a third party, yet neither pays nor receives any compensation for that effect. If the impact on the third party is adverse, it is called a negative externality.
The following graph shows the demand and supply curves for a good with this type of externality. The dashed drop lines on the graph reflect the market equilibrium price and quantity for this good.
Shift one or both of the curves to reflect the presence of the
externality. If the social cost of producing the good is not equal to
the private cost, then you should shift the supply curve to reflect the
social costs of producing the good; similarly, if the social value of
producing the good is not equal to the private value, then you should
shift the demand curve to reflect the social value of consuming the
good.