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

# Price-Searcher Markets

Three types of markets consist fo
r 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

## Upward-sloping Marginal Revenue

The text shows that an apparently well-behaved demand curve can 
generate a marginal revenue curve that rises over some range. The 
example below uses a cubic representation to illustrate this possibility.

kill(all)$  p(x,a,b,c,d):=a*x^3 + b*x^2 +c*x +d;

The next cell shows a demand curve that slopes downward throughout
but whose slope is close to zero in the mid-range than at the 
lowest and highest values of x.

[a0,b0,c0,d0] : [-0.018, +1.1, -23.0, 4000.0]$
xmax0: find_root(p(x,a0,b0,c0,d0), x,0,500);
wxdraw2d(xlabel="x", ylabel="$ per unit",
 explicit(p(x,a0,b0,c0,d0),x, 0, xmax0))$

The next cell creates the total revenue and marginal revenue functions.

tr(x,a,b,c,d):=''(radcan(p(x,a,b,c,d)*x));
 mr(x,a,b,c,d):=''(diff(tr(x,a,b,c,d),x));

The next cell adds the marginal revenue curve and truncates
the range to emphasize curvature properties.

wxdraw2d(yrange=[mr(30,a0,b0,c0,d0),d0],xlabel="x",
 ylabel="$ per unit", key = "Demand", explicit(
 p(x,a0,b0,c0,d0),x,0,30),key="Marginal Revenue",
 line_width=2,explicit(mr(x,a0,b0,c0,d0),x,0,30)  )$

The next cell creates a list that consists of two lists. The 
first embedded list shows the values of x for which the 
second derivative of the total revenue function (the first 
derivative of the marginal cost function) equals zero. The second 
embedded list shows the implied marginal revenue values.

[soln2: float(solve(diff(mr(x,a0,b0,c0,d0),x), x)),
[mr1: float(mr(rhs(soln2[1]), a0, b0, c0, d0)),  
 mr2: float(mr(rhs(soln2[2]), a0, b0, c0, d0))]];

Assume that marginal cost is constant throughout this range.
The selected value is an arbitrarily selected number within the
range shown in the second embedded list above.

mc0:3810$     
wxdraw2d(yrange=[.99*mr1,1.01*mr2],
 user_preamble="set key bottom left",
 xlabel="x",ylabel="$ per unit", line_width=2,
 key = "Demand",   explicit(p(x,a0,b0,c0,d0),x,0,30), 
 color=red,key="MR",explicit(mr(x,a0,b0,c0,d0),x,0,30),
 color=black,key="Constant MC", explicit(mc0,x,0,30))$

The next cell identifies the three points on the graph at which 
mr = mc. Inspection of the graph reveals that second-order conditions
imply that x1 and x3 correspond to local maximum values for profit and
that x2 implies a local minimum value.

[x1:find_root(mr(x,a0,b0,c0,d0)-mc0,x,0,10),
x2:find_root(mr(x,a0,b0,c0,d0)-mc0,x,x1+1,20),
x3:find_root(mr(x,a0,b0,c0,d0)-mc0,x,x2+1,50)]$
matrix(["x1","x2","x3"],[x1,x2,x3]);

We determine the profit level at each x value.

[P1: tr(x1,a0,b0,c0,d0) - (mc0*x1 + F),
P2: tr(x2,a0,b0,c0,d0) - (mc0*x2 + F),
P3:tr(x3,a0,b0,c0,d0) - (mc0*x3 + F) ]$
matrix(["Profit1","Profit2","Profit3"],[P1,P2,P3]);

550/538.0; 686/113.4;

The cell above shows that x3 is the best selection from the firm's
viewpoint, but that the profit level there is only about 2% higher
than at x1.

In contrast, the next cell shows that the deadweight loss if the
firm selects x1 is about six times as large as it would be if the
firm selects x3.

[xeff: find_root(p(x,a0,b0,c0,d0)-mc0,x,0,100),
DWL1: float(integrate(p(x,a0,b0,c0,d0)- mc0,x, x1,xeff)),
DWL3: float(integrate(p(x,a0,b0,c0,d0)- mc0,x, x3,xeff))]$
matrix(["Efficient x", "DWL, x1","DWL, x3" ],[xeff,DWL1,DWL3]);

## Monopolistic Competition