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

# Nonlinear Pricing: 
    Capturing Consumer Surplus

The workbook deals with "nonlinear pricing" -- pricing when the firm
can either charge different prices for different units of a good or 
can charge a fee in addition to the per-unit price.

## Review and Introduction

## First-degree Price Discrimination

## Price Discrimination in Segmented Markets

## Product Line Pricing

We begin with a case in which two markets and then allow
for interdependence between the markets. Finally we address
a closely related issue, the pricing of a product line.

The functional relationships below, used throughout the section,
consist of demand functions for market (or good) A and market (or good) B 
and the firm's profit function. Constant marginal cost is assumed.

All functions are linear, but we do specify a set of elasticities and 
derive the requisite slope values.

The own-price elasticity values are negative, and the cross-price 
elasticity values are positive. The good sold in market A and the
same good sold in market B are substitutes. Complementary goods
are considered later.  

This last command in this cell provides a logic check. If Eab0 and
Eba0 have opposite signs, then a warning is posted. 

kill(all)$  
/*These values are for the determination of slopes. They are
  not equilibrium values.*/
[xa0,xb0,pa0,pb0]:[100,100,10,10]$

/*These elasticity values are used to compute slopes */   
[Eaa0,Eab0,Eba0,Ebb0]:[-2.5,0,0.0,-4.0];   

/*Determination of slopes */
[a1,a2,b1,b2]:[Eaa0*xa0/pa0,Eab0*xa0/pb0, 
     Eba0*xb0/pa0, Ebb0*xb0/pa0];      
if sign(Eab0) = sign(Eba0) then 
"OK: Eab0 and Eba0 have the same sign" else 
"Error: Eab0 and Eab0 must have the same sign";

### Separate Markets and Price Discrimination

In the cell above, Eab = Eba = 0, so the demand for the good in market A 
is not affected by the price in market B, and vice versa. With this 
restriction, we review price discrimination using linear representations.

Before proceding, we complete the specification of the two demand curves
by calculating the intercept terms using the implicit relationships
xa0 - (a0 + a1*pa0 + a2*pb0) = 0 and xb0 - (b0 + b1*pa0 + b2*pb0 = 0.

We arbitrarily specify that marginal cost be one-half of the value of the
minimum intercept term, to ensure that both markets are served. Of course,
any proper fraction could be used.

a0:xa0-a1*pa0-a2*pb0$  b0: xb0-b1*pa0-b2*pb0$
[ca0, cb0] : min(-a0/a1, -b0/b2)/2$
xa : a0 + a1*pa + a2*pb;  xb: b0 + b1*pa + b2*pb;
P : xa*(pa - ca0) + xb*(pb-cb0);

Generating the two first partial derivatives of the profit function
with respect to prices and setting these functions equal to zero
yields the profit-maximizing prices.

soln1:float(solve([diff(P,pa), diff(P,pb)],[pa,pb]));

These two prices provide the remaining information, the quantities
in the two markets, the marginal revenue values in the two markets,
and the own-price elasticity values in the two markets. 

[pa1, pb1]:[rhs(soln1[1][1]), rhs(soln1[1][2])]$
[xa1, xb1]:[xa, xb],soln1[1]$  P1 : P, pa=pa1, pb=pb1$
[Eaa1, Ebb1]:[a1*pa1/xa1, b2*pb1/xb1]$
[mra1, mrb1]:[pa1*(1+1/Eaa1), pb1*(1+1/Ebb1)]$  
matrix(["pa","xa","Eaa","mra"],[pa1, xa1,Eaa1,mra1] );
matrix(["pb","xb","Ebb","mrb"],[pb1,xb1,Ebb1,mrb1] );
matrix(["mc","P"],[ca0, P1] );

### Imperfect Market Segmentation

Suppose that  Eab and Eba are both positive. Then the two markets are
not completely separate.

To analyze this case we replace the specification used above with this
slightly different one. We then follow the same steps to determine the
linear demand curves' parameters.

kill(all)$   [xa0, xb0, pa0, pb0] : [100, 100, 10, 10]$
[Eaa0,Eab0,Eba0,Ebb0]:[-2.5,0.5,0.25,-4.0]; [a1,a2,b1,b2]:
  [Eaa0*xa0/pa0, Eab0*xa0/pb0,Eba0*xb0/pa0,Ebb0*xb0/pa0];
if sign(Eab0) = sign(Eba0) then 
"OK: Eab0 and Eba0 have the same sign"
 else "Error: Eab0 and Eab0 must have the same sign";

a0: xa0 - a1*pa0 - a2*pb0$ b0: xb0 - b1*pa0 - b2*pb0$
[ca0, cb0] : min(-a0/a1, -b0/b2)/2$
xa : a0 + a1*pa + a2*pb$   xb: b0 + b1*pa + b2*pb$
P : xa*(pa - ca0) + xb*(pb-cb0)$

soln1:float(solve([diff(P,pa), diff(P,pb)],[pa,pb]))$

The major difference between this case and the previous one is that in both 
markets, the firm sells less than the amount that results in the equality 
of marginal revenue and marginal cost. The reason is that selling additional
units in either market now has two effects. First, it reduces the price
in that market, as is the case for any seller whose product faces a 
downward-sloping demand curve. In addition, this lower price reduces demand 
in the other market.

[pa1,pb1]:[rhs(soln1[1][1]), rhs(soln1[1][2])]$
[xa1,xb1]:[xa, xb],soln1[1]$  
P1:subst([pa=pa1, pb=pb1],P)$
[Eaa1, Ebb1]:[a1*pa1/xa1, b2*pb1/xb1]$
[mra1, mrb1]:[pa1*(1+1/Eaa1), pb1*(1+1/Ebb1)]$  
matrix(["pa","xa","Eaa","mra"],[pa1, xa1,Eaa1,mra1]);
matrix(["pb","xb","Ebb","mrb"],[pb1,xb1,Ebb1,mrb1]);
matrix(["mc", "P"],[ca0, P1]);

### Pricing Complementary Goods

Analytically, the preceding analysis could be interpreted as addressing
markets for two different goods that are substitutes. If we change the
sign of the cross elasticities, then we are looking at two complementary
goods.

In both this example and the preceding one ca = cb. This restriction can
be relaxed.

kill(all)$   [xa0,xb0,pa0,pb0]:[100,100,10,10]$
[Eaa0, Eab0, Eba0, Ebb0]: [-2.5, -0.5, -0.25, -4.0];
[a1, a2, b1, b2]: [Eaa0*xa0/pa0, Eab0*xa0/pb0, 
    Eba0*xb0/pa0, Ebb0*xb0/pa0];
if sign(Eab0) = sign(Eba0) then 
"OK: Eab0 and Eba0 have the same sign" else 
"Error: Eab0 and Eab0 must have the same sign";

a0:xa0-a1*pa0-a2*pb0$  b0:xb0-b1*pa0-b2*pb0$
[ca0, cb0] : min(-a0/a1, -b0/b2)/2$
xa:a0+a1*pa+a2*pb$    xb:b0+b1*pa+b2*pb$
P : xa*(pa - ca0) + xb*(pb-cb0)$
soln1:float(solve([diff(P,pa),diff(P,pb)],[pa,pb]));

soln1:float(solve([diff(P,pa),diff(P,pb)],[pa,pb]));

In this case, the quantities of A and B are such that mr < mc.
This result reflects the fact that increasing xa reduces pa but
allows the firm to increase pb.

[pa1, pb1] : [rhs(soln1[1][1]),rhs(soln1[1][2])]$
[xa1, xb1] : [xa, xb],soln1[1]$ P1 : P, pa=pa1, pb=pb1$
[Eaa1, Ebb1] : [a1*pa1/xa1, b2*pb1/xb1]$
[mra1, mrb1] : [pa1*(1 + 1/Eaa1), pb1*(1 + 1/Ebb1)]$
matrix(["pa","xa","Eaa","mra"],[pa1, xa1,Eaa1,mra1] );
matrix(["pb","xb","Ebb","mrb"],[pb1,xb1,Ebb1,mrb1] );
matrix(["mc", "P"],[ca0, P1] );