Competitive Markets

Hal Varian
January 1992

The supply function

Let's construct a supply function with U-shaped average variable costs.  First we experiment a bit to get a nice U-shape that we'll use for our AVC curve.  Then we multiply by y to get variable costs, and finally, add a fixed cost:

avcPlot=Plot[10+(y-5)^2,{y,0,15},AxesOrigin->{0,0}]

c[y_] := 10y + y(y-5)^2+20

acPlot=Plot[Evaluate[c[y]]/y,{y,.1,15}]

mcPlot=Plot[Evaluate[D[c[y],y]],{y,.1,15}]

Here they are all together:

Show[avcPlot,acPlot,mcPlot]

Welfare economics

Let's see how we get to a welfare maximum.  Take the following utility and cost functions:

u[x_] := Log[x]
c[y_] := y^2

inverseDemand[x_] := Evaluate[u'[x]]
inverseSupply[x_] := Evaluate[c'[x]]
Plot[{inverseSupply[x],inverseDemand[x]},{x,.1,3}]

We'll plot benefit minus cost on the same scale:

Plot[u[x]-c[x],{x,.1,3}]

The equilibrium value of x is given by

solution1=Solve[inverseDemand[x] == inverseSupply[x],][[1]]

Taxes

Let's use the same demand and supply functions to calculate equilibrium with taxes.  If a tax of t=.10 is imposed, the new equilibrium is

solution2=Solve[inverseDemand[x] == 
                inverseSupply[x]+ 0.1][[1]]

Now we'll plug this into the welfare function and see what the deadweight loss is.

deadweightLoss=N[(u[x]-c[x]/.solution2)-
                 (u[x]-c[x])/.solution1]

Let's make a little graph depicting deadweight loss as a function of the tax level.  First we'll write a function to compute total benefits as a function of the tax rate.

solution3=Solve[inverseDemand[x] == 
                inverseSupply[x]+ t,x][[1]]
netWelfare[t_] := (u[x]-c[x]/.solution3)
netWelfare[t]

Plot[netWelfare[t],{t,0,1}]