# International Trade Theory I

The analysis of real international trade (as distinct from international
finance) is based on general equilibrium models.

The Ricardian model is the most basic and perhaps the most famous
of all international trade models. This exercise set develops this model
as it appears in Krugman and Obstfeld, International Economics: Theory
and Policy.

## Production in Home and Foreign Countries

Each of two countries (home and foreign) produces the goods cloth (C)
and wine (W), using a single variable input labor (L).

Even with this 2 x 2 model, the number of parameters is fairly large, so a system of 
notation is useful. We suggest the following:

CH, WH, CF, and WF are cloth and  wine production at home and in the foreign country.
aLCH, aLWH, aLCF, and aLWF are the input coefficients for cloth and wine in the home 
   and foreign countries.
LH and LF are total labor supplies.
LCH, LWH, LCF, and LWF are the amounts of labor used in the indicated sector, in the
   indicated country.

Don't forget that Maxima is case-sensitive.

Determine the quantities of WH and WF as functions of CH and CF. Solve
aLWH*WH = LH - aLCH*CH for WH and a similar expression for WF.

kill(all)$ fpprintprec:5$ ratprint:false$
aLWH*WH = LH - aLCH*CH;   solnWH: solve(%,WH);
aLWF*WF =  LF - aLCF*CF;     solnWF: solve(%,WF);

To facilitate graphing, create functions (WH(CH,aLCH,aLWH,LH) and 
WH(similar arguments). 

/*Input. Execute (ctrl-enter) for results */
WH(CH,aLCH,aLWH, LH):=''(rhs(solnWH[1]));
WF(CF,aLCF,aLWF, LF):=''(rhs(solnWF[1]));

Draw the graphs of the two PPCs based on these parameter values:
[aLCH0,aLWH0,LH0]:[30,40,2400]$ and [aLCF0,aLWF0,LF0]:[90,40,3600]$.
Which country has a comparative advantage in producing cloth? What is
is opportunity cost per unit of cloth (measure in terms of wine foregone)?

/*Input. Execute (ctrl-enter) for results */
[aLCH0,aLWH0,LH0]:[30,40,2400]$
[aLCF0,aLWF0,LF0]:[90,50,3600]$
wxdraw2d(xlabel="C",ylabel="W",line_width=2,
key = "Home PPC",
explicit( WH(CH,aLCH0,aLWH0, LH0),CH,0,LH0/aLCH0),
color=black,key = "Foreign PPC",
explicit( WF(CF,aLCF0,aLWF0, LF0),CF,0,LF0/aLCF0) )$

Differentiate WH(.) with respect to CH and WF(.) with respect to CF
to derive the general expressions for opportunity costs of cloth in
these two countries. Substitute the parameter values into the 
expressions to determine each country's opportunity cost of cloth.

/*Input. Execute (ctrl-enter) for results */
[cCH: -diff(WH(CH,aLCH,aLWH, LH),CH),
 cCF: -diff(WF(CF,aLCF,aLWF, LF),CF)];
[cCH0,cCF0] : subst([aLCH=aLCH0,aLWH=aLWH0, aLCF=aLCF0,
  aLWF=aLWF0],  [cCH, cCF]);

## Digression: Efficient Production Assignment

Before considering how markets for these two goods would allocatte 
resources in each country, suppose that the technologies are known to a 
planner who is charged with assigning production efficiently, and has the
power to carry out this task.

Create two expressions, Wmax0 and Cmax0 that state the maximum W and C, 
respectively, that could be produced if all labor (LH0 + LF0) could be allocated
to the indicated good. Then invert the Cmax0 expression so that C is stated in 
terms of W.

/*Input. Execute (ctrl-enter) for results */
Wmax0: LH0/aLWH0 + LF0/aLWF0 - min(cCH0,cCF0)*C;
Cmax0: LH0/aLCH0 + LF0/aLCF0 - min(1/cCH0,1/cCF0)*W;
/*The opportunity cost of W interm of C is the reciprocal of the 
   opportunity cost of C in terms of W. */
solve(Cmax0=C,W);
Cmax0inverse:rhs(%[1]);

Graph the two expressions above. You can use implicit(C-Cmax0 ... ) or
explicit(Cmax0inverse ... ). 

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(yrange=[0,2*(LH0/aLWH0 + LF0/aLWF0)],
xlabel="C",ylabel="W",line_width=2,key="Home PPC",
explicit(Wmax0,C,0,2*(LH0/aLCH0+LF0/aLCF0)),
color=black, key="Foreign PPC",
implicit(C-Cmax0,C,0,2*(LH0/aLCH0+LF0/aLCF0), 
                 W, 0, 2*(LH0/aLWH0+LF0/aLWF0))   )$

The two-country production possibilities are defined as the area 
below the lower of the two lines. 

Create a functional expression that defines the maximum W for a 
given C value using min(Wmax0,Cmax0inverse).  Graph that 
function.

/*Input. Execute (ctrl-enter) for results */
f0(C):= ''(min(Wmax0,Cmax0inverse));
wxdraw2d(xlabel="C",ylabel="W", line_width=2,
key="Joint PPC", explicit(f0(C),C,0,120)    )$

## Market Allocation

In each country, the production technology defined above 
results in constant-cost industries. We consider the market 
for cloth. The wine industry can be ignored because the cloth
quantity dictates the wine quantity.

Define an inverse supply curve for C as a function of the quantity
of C. This supply curve will consist of a logical if ... then ...
else expression.

/*Input. Execute (ctrl-enter) for results */
sC(C):=''(if C <= LH0/aLCH0 then cCH0 else cCF0);

Draw the inverse supply curve.

wxdraw2d(yrange=[0,3], xlabel="Cloth Quantity",
ylabel="Relative price, pc/pw", 
key="Inverse Supply Curve",
explicit(sC(C),C,0,120)  )$

Create a linear function dC(C,a) for the inverse demand curve,
a - C/30.

/*Input. Execute (ctrl-enter) for results */
dC(C,a):= a - C/30;

Copy the cell that graphs the supply curve and add two demand
curves, with a = 2 and a = 4. Confirm that when a = 2, the home
country does not specialize. Rather, producers in the home
country supply about 40 units of cloth and allocate the remainder
of the home country's labor to wine. 

Confirm that when a = 4, both countries specialize, with the home
country producing only cloth and the foreign country producing only
wine. What is the approximate relative price of cloth to wine in this
case?

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(yrange=[0,4], xlabel="Cloth Quantity",
line_width=2, ylabel="Relative price, pc/pw", 
key="Inverse Supply Curve",explicit(sC(C),C,0,120),
color=black, key = "Inverse Demand Curve 1",
explicit(dC(C,2),C,0,50),
key = "Inverse Demand Curve 2",
explicit(dC(C,4),C,0,150)    )$

Set sC(C)-dC(C,4)=0 to confirm that C = 4. Use dC(C,4) to
determine the relative price of cloth. Confirm that the price is
between the home opportunity cost of cloth and that in the 
foreign country.

/*Input. Execute (ctrl-enter) for results */
find_root(sC(C)-dC(C,4),C,0,100);
float([cCH0,dC(%,4), cCF0]);

## Gains from Trade

As long as pc/px is between 0.75 and  1.8, both countries can gain from
trade. Graph the consumption possibilities for the home country if 
p = pc/px = 4/3, showing that (1) the home country produces only 
cloth and (2) that for every level of cloth that it continues to consume 
(does not export) it can consume more wine than it could without trade.

Note an important lesson of this simple example: Exports are costs, not
benefits. (That is, this is true from the viewpoint of society as a whole;
to individual exporters, the opportunity to sell abroad provides benefits.)

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(xlabel="C",ylabel="W",line_width=2,
key = "Home PPC",
explicit( WH(CH,aLCH0,aLWH0, LH0),CH,0,LH0/aLCH0),
color=black,key="Home Consumption Possibilities",
explicit(dC(80,4)*80 - dC(80,4)*C, C,0,80) )$

Do the same thing for the foreign country.

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(xlabel="C",ylabel="W",line_width=2,
yrange=[0,80],key = "Foreign PPC",
explicit( WF(CF,aLCF0,aLWF0, LF0),CF,0,LF0/aLCF0),
color=black,key="Foreign Consumption Possibilities",
explicit(72 - C*dC(80,4), C,0,80) )$

The cell below contains a demonstration, not an exercise. It shows a way
to produce an animation of the preceding figure. The relative price, p =
pc/pw, states at 1.8, the opportunity cost in the foriegn country, and it 
falls in increments of 0.18 until it reaches 0.9. The graph shows that a 
falling price of cloth constitutes a movement in the terms of trade 
toward the cloth-importing country. 

Suggested exercise: Use this as a model and construct an animation for 
the home country.

with_slider_draw( p, makelist(1.8*(1-.1*i),i,0,5) , yrange=[0,80],
title=concat("pc/pw = ",string(p)),
xlabel="C",ylabel="W",line_width=2,key = "Foreign PPC",
explicit( WF(CF,aLCF0,aLWF0, LF0),CF,0,LF0/aLCF0),
color=black,key="Foreign Consumption Possibilities",
explicit(72 - C*p, C,0,60))$

The simple Ricardian model was designed to show that gains from
trade can occur whenever two countries (or regions, or people) 
have different comparative advantages. It does not disaggregate.
As the partial equilibrium exercises show, opening to trade does 
result in losses as well as gains, though gains tend to be larger.
The simplest general equilibrium model, the Ricardian model, 
misses this aspect.

The next exercise set looks at the Specific Factors model, which
addresses this aspect of trade.