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

# Oligopoly

his chapter examines models that offer insights into the behavior of
oligopolists.

## Introduction and Overview

## The Cournot Model

## The Stackelberg Model

The Stackelberg model assumes that neither firm thinks that the other(s) will 
respond to its output decision.

This model differs from the Cournot model in that one firm acts first and the 
second firm follows. The leader assumes that the follower will react to
the leader's best response function. This implies that the follower's reaction 
curve determines the demand for the leader's output level.

The next cell reproduces the demand and marginal cost functions that were used 
in the Cournot example.

kill(all)$
p(x1,x2,A,B):= A + B*(x1 + x2);
[mc1(x1,b1,c1):=b1+c1*x1,mc2(x2,b2,c2):=b2+c2*x2];
[A0,B0,b10,c10,b20,c20] : [100.0, -2.0, 5.0, 2.0, 10.0, 1.0]$
[p(x1,x2,A0,B0),mc1(x1,b10,c10),mc2(x2,b20,c20)];

Firm1, the leader, takes Firm2's reaction function as given, so we begin by 
deriving that function. This approach (solving the game starting with the 
last strategic decision), known as backward induction, is standard in Game Theory. 

Here is Firm2's profit function.

P2(x1,x2,A,B,b2,c2):= ''(
  p(x1,x2,A,B)*x2 - integrate(mc2(x2,b2,c2),x2 )- F2);

Setting the derivative of the profit function P2(...) with respect to x2 equal to 
zero and solving for x2 yields Firm2's reaction curve. We name the solution stackx2 
and use it to define Firm2's reaction function, R2stack(...).

x2stack: solve(diff(P2(x1,x2,A,B,b2,c2),x2),x2);
R2stack(x1,A,B,b2,c2):=''(rhs(x2stack[1]));

Firm1 knows that Firm2's reaction curve and commits to an output level that maximizes 
its profits. The inverse demand for Firm1's product and its profit function appear below.

p1(x1,A,B,b2,c2):=''(subst(x2stack, p(x1,x2,A,B)));
P1(x1,A,B,b1,c1,b2,c2):= ''(
   p1(x1,A,B,b2,c2)*x1 - integrate(mc1(x1,b1,c1),x1) - F1);

The expression for Firm1's reaction function is derived as before.

diff(P1(x1,A,B,b1,c1,b2,c2),x1);
x1stack: rhs(solve(%,x1)[1]);

Insert the expression x1stack into Firm2's reaction curve.

R2stack(x1stack,A,B,b2,c2);

The next cell determines the quantities produced by the two firms.

x1stack0: subst([A=A0,B=B0,b1=b10,c1=c10,
  b2=b20,c2=c20],x1stack);
R2stack(x1stack0,A0,B0,b20,c20);