load(draw)$ 
set_draw_defaults(draw_realpart=false)$
 fpprintprec:5$ ratprint:false$kill(all)$

# Price-Searcher Markets

Three types of markets consist for firms whose output affects the firm's
(or firms') product price. We refer to these as price-searcher markets, 
for the firm must search for the profit-maximizing price.

The simplest type of such a market is the monopoly, in which the market
is served by a single firm, and in which no entry occurs. A second type
is monopolistic competition, in which each of many firms sells a 
slightly distinctive product, but in which entry can occur as long as 
profits are to be earned. 

In both of these cases, the firm can ignore the 
effect of is output on the behavior of other firms. In the first case
this is true because no other firms exists. In the second case, it is
because no firm is large enough to significantly affect the 

This chapter treats these two cases. The next chapter deals with
oligopoly, in which a few firms constitute the industry. In this 
case we must model the effect that each firm has on the decisions
of other firms.

## Monopoly

We assume that the monopolist, facing a given demand curve,
sells the quantity that yields maximum profit. 

### Quantity, Price, and Marginal Revenue

The graph below shows why marginal revenue (dTR/dx) is less than
price: to sell more, the firm must reduce the price on all units.
(Later, we relax this assumption a bit.)

[x1, x2]:[8,15]$  [p1, p2]:[50.0-2*x1,50-2*x2]$
matrix(["x1","p1","x2","p2"],[x1,p1,x2,p2]);
wxdraw2d(title="Effects of increased x", xlabel="x", 
ylabel = "$ per unit",yrange=[0, 60],line_type=dots,
 points_joined=true,points([[x1,0],[x1,p1],[0,p1]]),
 points([[x2,0],[x2,p2],[0,p2]]),line_type=solid,
 line_width=2,key="Demand",explicit(50-2*x,x,0,30),
 label(["Gain, higher x",11.5,10]), 
 label(["Loss,lower p",4,25]),dimensions=[640,490] )$

The cell below calculates the change in revenue per unit change
in quantity. That is, it calculates the (arc) marginal revenue for
the range portrayed above.

[Gain,Loss]:[p2*(x2-x1),x1*(p1-p2)]$ 
NetGain:Gain-Loss$  PerUnitNetGain:NetGain/(x2-x1)$
matrix(["Gain","Loss","NetGain", "PerUnitNetGain"],
[Gain,Loss,NetGain,PerUnitNetGain]);

The next graph shows the (point) marginal revenue (dTR/dx) at
each x. It also shows the arc marginal revenue computed above.

wxdraw2d(xlabel ="x",ylabel = "$ per unit",yrange=[0,60],
 line_type=dots,points_joined=true,points([[x1,0], 
   [x1,p1],[0,p1]]),points([[x2,0],[x2,p2],[0,p2]]), 
 points([[(x1+x2)/2, PerUnitNetGain]]),line_type = solid,
 line_width=2,key="Demand",explicit(50-2*x,x,0,30),key = 
"Marginal Revenue",line_width=1,explicit(50-4*x,x,0,30))$

The relationship below is approximately correct for any functional
form and exactly correct for the linear demand curve. The 
approximation improves as the change in x becomes small.

arcEp:((x2-x1)/((x2+x1)/2))/((p2-p1)/((p2+p1)/2))$
arc_mr:0.5*(p1+p2)*(1 + 1/arcEp)$
matrix(["arc Elasticity","arc MR"],[arcEp,arc_mr]);

The relationship between arc elasticity and arc marginal
revenue is exact when the average p and q are replaced
by the lower of the two values. 

(x2-x1)/((p2-p1))*(p2/x1); p2*(1+1/%);

### Profit Maximization Illustrations

This section  illustrates profit maximization using 
three shapes for demand curves: linear, constant-elasticity, and quadratic. 

The next cell defines the inverse demand curves and the implied marginal
revenue curves. The upper-case L, CE, and Q identify the demand curve type.

pL(xL, A,a):=A+a*xL$  mrL(xL,A,a) := A+2*a*xL$
pCE(xCE, B, b) := (xCE/B)^(1/b)$      
mrCE(xCE, B, b) := (1 + 1/b)*(xCE/B)^(1/b)$
pQ(xQ,M,m):=M+m*xQ^2$  mrQ(xQ,M,m):=M+3*m*xQ^2$  
mc(X,C0,c0):=C0+c0*X$

Parameter values are specified below. 

[a0,b0,m0]:[-4.0,-2.0,-2]$ 
[A0,B0,M0]:[-5*a0,4/10^b0,- 25*m0]$  
C0:5$   c0:(10-C0)/4.0$   
matrix(
  ["A0","a0","B0","b0","M0","m0","C0","c0"], 
  [A0, a0, B0, b0, M0, m0, C0, c0]);

For each case, we find the quantity which marginal revenue equals marginal 
cost. For the linear case, solve( ) yields an analytical solution.
For the other two, find_root( ) provides numerical solutions.

Once x is found, price (p), and profit (P) are computed. As
a check, we compute mr and mc, the values of which should be equal.

/*Linear*/solve(mrL(xL,A0,a0)=mc(xL,C0,c0),xL)$
xL0: float(rhs(%[1]))$    pL0:pL(xL0,A0,a0)$
PL0:float(integrate(mrL(xL,A0,a0)-mc(xL,C0,c0),xL,
  0,xL0)-F)$ matrix(  ["xL0","pL0","avcL0","PL0",
"mrL0","mcL0"],[xL0,pL0,C0+.5*c0*xL0,PL0,
  mrL(xL0,A0,a0),mc(xL0,C0,c0)]);
/*CE*/ xCE0:find_root(mrCE(xCE,B0,b0)=mc(xCE,C0,c0),
  xCE,.1,5)$  pCE0:pCE(xCE0,B0,b0)$ 
  PCE0:(pCE0-(C0+c0*xCE0/2))*xCE0-F$ float(integrate(
   mrCE(xCE,B0,b0)-mc(xCE,C0,c0),xCE,0,xCE0)-F)$
matrix(["xCE0","pCE0","avcCE0","PCE0","mrCE0","mcCE0"], 
       [xCE0,pCE0,C0+.5*c0*xCE0,PCE0, mrCE(xCE0,B0,b0), 
        mc(xCE0, C0,c0)]);
/*Quadratic*/ xQ0:find_root(mrQ(xQ,M0,m0)=
  mc(xQ,C0,c0),xQ,0,5)$ pQ0:pQ(xQ0,M0,m0)$  
  PQ0:float(integrate(mrQ(xQ,M0,m0)-mc(xQ,C0,c0),
  xQ,0,xQ0)-F)$  
matrix(["xQ0","pQ0","avcQ0","PQ0","mrQ0","mcQ0"],
  [xQ0,pQ0,C0+.5*c0*xQ0, PQ0,mrQ(xQ0,M0,m0),
  mc(xQ0,C0,c0)]);

The graph below shows the three cases.

Linear:gr2d(xlabel="x",ylabel="$ per unit",yrange=[0,A0],
 points_joined=true,points([[xL0,0],[xL0,pL0],[0,pL0]]),
 line_width=2, key="D",explicit(pL(xL,A0,a0),xL,0,5),
 color=red,key="MR",explicit(mrL(xL,A0,a0),xL,0,5),
 color=black,key="MC",explicit(mc(X,C0,c0),X,0,5))$

ConstElas: gr2d( xlabel="x",ylabel="$ per unit",
 xrange=[0,5], yrange=[0,50],points_joined=true,
 points([[xCE0,0],[xCE0,pCE0],[0,pCE0]]),line_width=2,
 key="D",explicit(pCE(xCE,B0,b0),xCE,0.1,5),color=red,
 key="MR",explicit(mrCE(xCE,B0,b0),xCE,0.1,5),color=black,
 key="MC",explicit(mc(X,C0,c0),X,0,5) )$

Quadratic: gr2d(xlabel="x",ylabel="$ per unit",
 yrange=[0,M0],points_joined=true,
 points([[xQ0,0],[xQ0,pQ0],[0,pQ0]]), line_width=2,
 key="D",explicit(pQ(xQ,M0,m0),xQ,0,5),color=red,
 key="MR",explicit(mrQ(xQ,M0,m0),xQ,0,5),color=black,
 key="MC",explicit(mc(X,C0,c0),X,0,5))$     

wxdraw(Linear,ConstElas,Quadratic,columns=3,dimensions=[700,360])$

Profit maximization requires that mr = p(1 + 1/E) = mc, where E is the price 
elasticity. This mark-up feature is implied: p = mc/(1 + 1/E), or
p = mc*(E/(1 + E)).

The next cell applies this markup in each of the three cases. The implied 
prices are those determined above.

EpL : (1/a0)*pL0/xL0$      EpCE : b0$
diff(pQ(xQ,M0,m0),xQ)$  EpQ :(1/%)*(pQ0/xQ0),xQ=xQ0$
matrix(["EpL", "pL", "EpCE", "pCE", "EpQ", "pQ"] , 
[EpL,(C0+c0*xL0)/(1+1/EpL),EpCE,(C0+c0*xCE0)/(1+1/EpCE),
EpQ, (C0 + c0*xQ0)/(1+1/EpQ)     ]);

The next cell confirms that when Ep is around -2, the price is
about twice the marginal cost. In contrast, Ep of approximately
-1.3 implies that price is more than 4 times marginal cost.

[EpL/(1+EpL),EpCE/(1+EpCE),EpQ/(1+EpQ)];

### Consumer Surplus and Deadweight Loss

That p > mc implies the existence of a deadweight loss. The 
table below shows the deadweight loss in each of the three 
examples above: DL0, DCE0, and DQ0. It also shows the amount
of consumer surplus at the profit-maximizing quantity in each
of the three cases.

xLe0:find_root(pL(xL, A0, a0) -mc(xL,C0,c0),
 xL,0,5)$CSL0:float(integrate(pL(xL, A0, a0)- 
 pL0,xL,0,xL0))$  DL0 : float(integrate(pL(xL,A0,a0)- 
 mc(xL,C0,c0),xL,xL0,xLe0))$ 
xCEe0 : find_root(pCE(xCE,B0,b0)-mc(xCE,C0,c0),
 xCE,0.1,5)$  CSCE0:float(integrate(pCE(xCE,B0,b0)- 
 pCE0,xCE,0,xCE0))$ DCE0:float(integrate(pCE(xCE,B0,b0)- 
  mc(xCE,C0,c0),xCE,xCE0,xCEe0))$
xQe0 : find_root(pQ(xQ,M0,m0)-mc(xQ,C0,c0),
 xQ,0,5)$CSQ0:float(integrate(pQ(xQ,M0,m0)- 
 pQ0,xQ,0,xQ0))$ DQ0:float(integrate(pQ(xQ,M0,m0)-
 mc(xQ,C0,c0),xQ,xQ0,xQe0))$

matrix(["xL0","xLe0","CSL0","DL0"],[xL0,xLe0,CSL0,DL0],
  ["--","--","--","--"],["xCE0","xCEe0",
"CSCE0","DCE0"],[xCE0,xCEe0,CSCE0,DCE0], ["--",
"--","--","--"],["xQ0","xQe0","CSQ0","DQ0"],
  [xQ0, xQe0, CSQ0, DQ0]  );

### Shifting Marginal Cost: An Excise Tax

Chapter 10 shows that imposing a tax on the purchase or sale of
a good in a compeititive market generates deadweight loss. This
section shows that the same is true for a monopolistic market. 

The table also shows that in at least one case (constant-elasticity
demand curve), the price can rise by more than the amount 
of the tax. The last output line shows the effect on price of a 
$1 per unit tax in each case. 

xL1:find_root(mrL(xL,A0,a0)=mc(xL,C0+1,c0),xL,0,5)$
pL1:pL(xL1,A0,a0)$
matrix(["xL0","pL0","xL1","pL1"],[xL0,pL0,xL1,pL1]);
xCE1:find_root(mrCE(xCE,B0,b0)=mc(xCE,C0+1,c0),
  xCE,0.1,5)$   pCE1:pCE(xCE1,B0,b0)$  matrix(
  ["xCE0","pCE0","xCE1","pCE1"],[xCE0,pCE0,xCE1,pCE1]);
xQ1 : find_root(mrQ(xQ, M0,m0)=mc(xQ,C0+1,c0),xQ,0,5)$
pQ1 : pQ(xQ1, M0, m0)$
matrix(["xQ0","pQ0","xQ1","pQ1"],[xQ0,pQ0,xQ1,pQ1]);
[pL1-pL0, pCE1-pCE0, pQ1-pQ0];

### Tax-Induced Deadweight Loss

The tax rate is 1.0 per unit, so the tax revenue equals the post-tax 
quantity,so we can directly compare the tax revenue with the 
resulting deadweight loss increase, which appears in the last column. 
In all cases, the added deadweight loss per dollar of tax revenue is 
large: 0.484 (= 0.732/1.5135), 1.4823 (= 2.3344/1.5749) and 0.328 
(= 0.856/2.6058) respectively for the three cases.

CSL1:float(integrate(pL(xL,A0,a0)-pL1,xL,0,xL1))$
DL1:float(integrate(pL(xL,A0,a0)-mc(xL,C0,c0),xL,xL1,xLe0))$    
CSCE1:float(integrate(pCE(xCE,B0,b0)-pCE1,xCE,0,xCE1))$
DCE1:float(integrate(pCE(xCE,B0,b0)-mc(xCE,C0,c0),
 xCE,xCE1,xCEe0))$  
CSQ1:float(integrate(pQ(xQ,M0,m0)-pQ1,xQ,0,xQ1))$
DQ1:float(integrate(pQ(xQ,M0,m0)-mc(xQ,C0,c0),xQ,
 xQ1,xQe0))$    
matrix( ["xL1","CSL1","DL1","ChgDL"], 
 [xL1,CSL1,DL1,DL1-DL0],["--","--","--","--"],
 ["xCE1","CSCE1","DCE1","ChgDCE"], [xCE1,CSCE1,
 DCE1,DCE1-DCE0],["--","--","--","--"],["xQ1",
"CSQ1","DQ1","ChgDQ"],[xQ1,CSQ1,DQ1,DQ1-DQ0]);

The graph below demonstrates why this loss is relatively large. 
The monopolist has already created deadweight loss as shown by the 
area between the demand and marginal cost curves to the right of 
the initial quantity. Now, imposing the tax adds a loss indicated
by the trapezoid defined by the area between the demand and original 
marginal cost curves from the post-tax quantity to the initial
quantity.

xmax: 1.25*max(xCE0, xCE1)$
wxdraw2d(yrange=[0, 1.75*max(pCE0,pCE1)],xlabel="x",
 ylabel="$ per unit",points_joined=true,line_type = dots,
 key="Initial x and p",points([[xCE0,0],[xCE0, 
 pCE0],[0,pCE0]]),color=green,key="Post-tax x and p",
 points([[xCE1,0],[xCE1, pCE1],[0, pCE1] ]), 
 line_type =  solid, color = black, line_width=2,
 key="Demand",explicit(pCE(xCE,B0,b0),xCE,0.1,2*xmax),
 color=blue, key = "Marginal Revenue", 
 explicit(mrCE(xCE,B0,b0),xCE,0.1, 2*xmax),
 color=red,key="MC",explicit(mc(X,C0,c0),X,0,2*xmax),color=orange,
 key="MC + 1",explicit(1 + mc(X, C0, c0),X,0, 2*xmax),
 key = "Area=tax revenue",fill_color=gray40,
 polygon([[0,0],[xCE1, 0],[xCE1, 1],[0,1]]),
 dimensions=[480,480])$

The next cell shows distributional effects in the case 
graphed above. Consumers are affected relatively more, given
the parameters of the demand and cost functions. 

PCE1 : (pCE1 - (C0 +1 + c0*xCE1/2))*xCE1 - F$
transpose(matrix( ["Price Change",
"Increased spending on post-tax units", 
"Tax Revenue","Consumer Surplus Change",
"Profit Change"],[(pCE1-pCE0),(pCE1-pCE0)*xCE1,
 xCE1,CSCE1-CSCE0,PCE1- PCE0]));

The cell below shows the corresponding values for the quadratic 
illustration. In this example, the system's parameters result 
in a larger impact on sellers than on buyers. 

PQ1:(pQ1-(C0+1+c0*xQ1/2))*xQ1-F$  transpose(matrix( 
 ["Price Change","Increased spending on post-tax units", 
"Tax Revenue","Consumer Surplus Change", "Profit Change"],
 [(pQ1 - pQ0),(pQ1-pQ0)*xQ1,xQ1,CSQ1-CSQ0,PQ1- PQ0]));

Finally, the linear case is presented. Again, given the 
system's parameters, the larger impact is on profits.

PL1 : (pL1 - (C0 +1 + c0*xL1/2))*xL1 - F$
transpose(matrix( ["Price Change",
"Increased spending on post-tax units", "Tax Revenue",
"Consumer Surplus Change","Profit Change"],[(pL1-pL0), 
(pL1-pL0)*xL1, xL1, CSL1-CSL0, PL1- PL0]));

## Upward-sloping Marginal Revenue