{'fraction_non_alphanumeric': 0.03980738362760835, 'fraction_numerical': 0.013868378812199036, 'mean_word_length': 4.381149806522941, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 70, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Comparative Advantage and Optimal Trade Policy

The theory of comparative advantage is at the core of neoclassical trade theory. Yet we know little about its implications for how nations should conduct their trade policy. For example, should import sectors with weaker comparative advantage be protected more? Conversely, should export sectors with stronger comparative advantage be subsidized less? In this paper we explore these issues in the context of a canonical Ricardian model. Our main results imply that optimal import tariffs should be uniform, whereas optimal export subsidies should be weakly decreasing with respect to comparative advantage, reflecting the fact that countries have more room to manipulate prices in their comparative-advantage sectors. Quantitative exercises suggest substantial gains from such policies relative to simpler tax schedules.


Introduction
Two of the most central questions in international economics are "Why do nations trade?" and "How should a nation conduct its trade policy?" The theory of comparative advantage is one of the most influential answers to the former question. Yet, it has had little impact on answers to the latter question. Our goal in this paper is to explore the relationship between comparative advantage and optimal trade policy.
Our main result can be stated as follows. The trade taxes that maximize domestic welfare in the models we consider, which we label optimal trade taxes, should be uniform across imported goods and weakly monotone with respect to comparative advantage across exported goods. Examples of optimal trade taxes include (i) a zero import tariff accompanied by export taxes that are weakly increasing with comparative advantage or (ii) a uniform, positive import tariff accompanied by export subsidies that are weakly decreasing with comparative advantage. While the latter pattern accords well with the observation that countries tend to protect their least competitive sectors in practice, in our model larger subsidies do not stem from a greater desire to expand production in less competitive sectors. Rather, they reflect tighter constraints on the ability to exploit monopoly power by contracting exports. Put simply, countries have more room to manipulate world prices in their comparative-advantage sectors.
Our starting point is a canonical Ricardian model of trade. We focus on this model because this is the oldest and simplest theory of comparative advantage as well as the new workhorse model for quantitative work in the field; see Eaton and Kortum (2012). We consider a world economy with two countries, Home and Foreign, one factor of production, labor, a continuum of goods, and Constant Elasticity of Substitution (CES) utility, as in Dornbusch et al. (1977), Wilson (1980), Eaton and Kortum (2002), and Alvarez and Lucas (2007). Labor productivity can vary arbitrarily across sectors in both countries. Home sets trade taxes in order to maximize domestic welfare, whereas Foreign is passive. In the interest of clarity we assume no other trade costs in our baseline model.
In order to characterize the structure of optimal trade taxes, we use the primal approach and consider first a fictitious planning problem in which the domestic government directly controls consumption and output decisions. Using Lagrange multiplier methods, we then show how to transform this infinite dimensional problem with constraints into a series of simple unconstrained, low-dimensional problems. This allows us to derive sharp predictions about the structure of the optimal allocation. Finally, we demonstrate how that allocation can be implemented through trade taxes and relate optimal trade taxes to comparative advantage.
Our approach is flexible enough to be used in more general environments that feature non-CES utility, arbitrary neoclassical production functions, and trade costs. In all such extensions we demonstrate that our techniques remain well-suited to analyzing optimal trade policy and show that our main insights are robust. For example, our main prediction-that optimal trade taxes are uniform across imported goods and weakly monotone with respect to comparative advantage across goods-holds without further qualification in a Ricardian model with uniform iceberg trade costs. Perhaps surprisingly, given the leap in generality, this prediction is only somewhat more nuanced without CES utility or with arbitrary neoclassical production functions.
The approach developed here can also be used for quantitative work. We apply our theoretical results to study the design of optimal trade policy in a world economy comprising two countries: the United States and the Rest of the World. We consider two separate exercises. In the first exercise, all goods are assumed to be agricultural goods, whereas in the second, all goods are assumed to be manufactured goods. We find that U.S. gains from trade under optimal trade taxes are 20% larger than those obtained under laissez-faire for the agricultural case and 33% larger for the manufacturing case. Interestingly, a significant fraction of these gains arises from the use of trade taxes that are monotone in comparative advantage. Under an optimal uniform tariff, gains from trade for both the agriculture and manufacturing exercises would only be 9% larger than those obtained under laissez-faire. While these two-country examples are admittedly stylized, they suggest that the economic forces emphasized in this paper may be quantitatively important as well. We hope that future quantitative work, in the spirit of Ossa (2011), will further explore this issue in an environment featuring a large number of countries and a rich geography of trade costs.
Our paper makes two distinct contributions to the existing literature. The first one, at the intersection of international trade and public finance, is related to the classical problem of optimum taxation in an open economy; see e.g. Torrens (1844) and Mill (1844). In his survey of the literature, Dixit (1985) sets up the general problem of optimal taxes in an open economy as a fictitious planning problem and derives the associated first-order conditions. As Bond (1990) demonstrates, such conditions impose very weak restrictions on the structure of optimal trade taxes. Hence, optimal tariff arguments are typically cast using simple general equilibrium models featuring only two goods or partial equilibrium models. In such environments, characterizing optimal trade taxes reduces to solving the problem of a single-good monopolist/monopsonist and leads to the prediction that the optimal tariff should be equal to the inverse of the (own-price) elasticity of the foreign export supply curve. 1 In this paper we go beyond the previous prediction by studying the relationship between comparative advantage and optimal trade taxes in the context of a canonical Ricardian model. In this environment, countries buy and sell many goods whose prices depend on the entire vector of net imports through their effects on wages. Thus the (ownprice) elasticity of the foreign export supply curve no longer provides a sufficient statistic for optimal trade taxes. Nevertheless our analysis shows that for any wage level, optimal trade taxes must satisfy simple and intuitive properties. What matters for one of our main results is not the entire schedule of own-price and cross-price elasticities faced by a country acting as a monopolist, which determines the optimal level of wages in a non-trivial manner, but the cross-sectional variation in own-price elasticities across sectors holding wages fixed, which is tightly connected to a country's comparative advantage.
The paper most closely related to ours is Itoh and Kiyono (1987), which shows that in a Ricardian model with Cobb-Douglas preferences, export subsidies that are concentrated on "marginal" goods are always welfare-enhancing. Though the logic behind their result is distinct from ours-a point we come back to in Section 4.3-it resonates well with our finding that, at the optimum, export subsidies should be weakly decreasing with comparative advantage, so that "marginal" goods should indeed be subsidized more. Our analysis extends the results of Itoh and Kiyono (1987) by considering a Ricardian environment with general CES utility and, more importantly, by solving for optimal trade taxes rather than providing examples of welfare-enhancing policies. 2 Beyond generality, our results also shed light on the simple economics behind optimal trade taxes in a canonical Ricardian model: taxes should be monotone in comparative advantage because countries have more room to manipulate prices in their comparative-advantage sectors.
More broadly, these novel results have implications for the recent debate regarding the consequences of micro-level heterogeneity for the welfare gains from trade; see Helpman (2013). In recent work, Arkolakis et al. (2012) have shown that, depending on how the question is framed, answers to micro-level questions may be of no consequence for predicting how international trade affects welfare within a broad class of models. These results rely on calibrating certain macro responses, thereby holding them fixed across models. Melitz and Redding (2013) offer a different perspective in which these behavioral responses are not held fixed. Regardless of these debatable methodological choices, our paper emphasizes policy margins that bring out the importance of micro structure. Our qualitative results-that trade taxes should be monotone in comparative advantage-and our quantitative results-that such trade taxes lead to substantially larger welfare gains than uniform trade taxes-illustrate that the design of and the gains associated with optimal trade policy may crucially depend on the extent of micro-level heterogeneity. Here, micro-level data matter, both qualitatively and quantitatively, for answering a key normative question in the field: How should a nation conduct its trade policy? 3 The second contribution of our paper is technical. The problem of finding optimal trade taxes in a canonical Ricardian model is infinite-dimensional (since there is a continuum of goods), non-concave (since indirect utility functions are quasi-convex in prices), and non-smooth (since the world production possibility frontier has kinks). To make progress on this question, we follow a three-step approach. First, we use the primal approach to go from taxes to quantities. Second, we identify concave subproblems for which general Lagrangian necessity and sufficiency theorems problems apply. Third, we use the additive separability of preferences to break down the maximization of a potentially infinite-dimensional Lagrangian into multiple low-dimensional maximization problems that can be solved by simple calculus. Beyond the various extensions presented in this paper, the same approach could be used to study optimal trade taxes in economies with alternative market structures such as Bertrand competition, as in Bernard et al. (2003), or monopolistic competition, as in Melitz (2003).
From a technical standpoint, our approach is also related to recent work by Amador et al. (2006) and Amador and Bagwell (2013) who have used general Lagrange multiplier methods to study optimal delegation problems, including the design of optimal trade agreements, and to Costinot et al. (2013) who have used these methods together with the time-separable structure of preferences typically used in macro applications to study optimal capital controls. We briefly come back to the specific differences between these various approaches in Section 3. For now, we note that, as in Costinot et al. (2013), our approach relies heavily on the observation, first made by Everett (1963), that Lagrange multiplier methods are particularly well suited for studying "cell-problems," i.e., additively separable maximization problems with constraints. 4 Given the importance of additively separable utility in the field of international trade, we believe that these methods could 3 Though we have restricted ourselves to a Ricardian model for which the relevant micro-level data are heterogeneous productivity levels across goods, not firms, the exact same considerations would make firm-level data critical inputs for the design of optimal policy in imperfectly competitive models. 4 In spite of this mathematical connection, there is no direct relationship between the results of Costinot et al. (2013), derived in a dynamic endowment economy, and the results of this paper, derived in a static Ricardian economy. From an economic standpoint, our predictions about the structure of optimal taxes rely crucially on the endogenous allocation of labor across sectors according to comparative advantage; they therefore have no counterparts in an endowment economy. prove useful beyond the question of how comparative advantage shapes optimal trade taxes. We hope that our paper will contribute to make such methods part of the standard toolbox of trade economists.
The rest of our paper is organized as follows. Section 2 describes our baseline Ricardian model. Section 3 sets up and solves the planning problem of a welfare-maximizing country manipulating its terms-of-trade. Section 4 shows how to decentralize the solution of the planning problem through trade taxes and derive our main theoretical results. Section 5 explores the robustness of our main insights to the introduction of non-CES utility, general production functions, and trade costs. Section 6 applies our theoretical results to the design of optimal trade taxes in the agricultural and manufacturing sectors. Section 7 offers some concluding remarks. All formal proofs can be found in the Appendix.

A Ricardian Economy
Consider a world economy with two countries, Home and Foreign, one factor of production, labor, and a continuum of goods indexed by i. 5 Preferences at home are represented by the Constant Elasticity of Substitution (CES) utility, (1 − 1/σ) denotes utility per good; σ ≥ 1 denotes the elasticity of substitution between goods; and (β i ) are exogenous preference parameters such that´i β i di = 1. Preferences abroad have a similar form with asterisks denoting foreign variables. Production is subject to constant returns to scale in all sectors. a i and a * i denote the constant unit labor requirements at home and abroad, respectively. Labor is perfectly mobile across sectors and immobile across countries. L and L * denote labor endowments at home and abroad, respectively.

Competitive Equilibrium
We are interested in situations in which the domestic government imposes ad-valorem trade taxes-cum-subsidies, t ≡ (t i ), whereas the foreign government does not impose any tax. Each element t i ≥ 0 corresponds to an import tariff if good i is imported or an export subsidy if it is exported. Conversely, each element t i ≤ 0 corresponds to an import subsidy or an export tax. Tax revenues are rebated to domestic consumers through a lump-sum transfer, T. Here, we characterize a competitive equilibrium for arbitrary taxes. Next, we will describe the domestic government's problem that determines optimal taxes. At home, domestic consumers choose consumption to maximize utility subject to their budget constraints; domestic firms choose output to maximize profits; the domestic government balances its budget; and the labor market clears: where p ≡ (p i ) ≥ 0 is the schedule of world prices; w ≥ 0 is the domestic wage; and q ≡ (q i ) ≥ 0 is domestic output. Similarly, utility maximization by foreign consumers, profit maximization by foreign firms, and labor market clearing abroad imply where w * ≥ 0 is the foreign wage and q * ≡ q * i ≥ 0 is foreign output. Finally, good market clearing requires In the rest of this paper we define a competitive equilibrium with taxes as follows.
Definition 1. A competitive equilibrium with taxes corresponds to a schedule of trade taxes t ≡ (t i ), a lump-sum transfer, T, a pair of wages, w and w * , a schedule of world prices, p ≡ (p i ), a pair of consumption schedules, c ≡ (c i ) and c * ≡ c * i , and a pair of output schedules, q ≡ (q i ) and q * ≡ q * i , such that conditions (1)-(8) hold. By Walras' Law, competitive prices are only determined up to a normalization. For expositional purposes, we set prices throughout our analysis so that the marginal utility of income in Foreign, that is the Lagrange multiplier associated with the budget constraint in (5), is equal to one. Hence the foreign wage, w * , also represents the real income of the foreign consumer.

The Domestic Government's Problem
We assume that Home is a strategic country that sets ad-valorem trade taxes t ≡ (t i ) and a lump-sum transfer T in order to maximize domestic welfare, whereas Foreign is passive. 6 Formally, the domestic government's problem is to choose the competitive equilibrium with taxes, (t, T, w, w * , p, c, c * , q, q * ), that maximizes the utility of its representative consumer, U (c). This leads to the following definition.
The goal of the next two sections is to characterize how unilaterally optimal trade taxes, i.e., taxes that prevail at a solution to the domestic government's problem, vary with Home's comparative advantage, as measured by the relative unit labor requirements a * i /a i . To do so we follow the public finance literature and use the primal approach as in, for instance, Dixit (1985). 7 Namely, we will first approach the optimal policy problem of the domestic government in terms of a relaxed planning problem in which domestic consumption and domestic output can be chosen directly (Section 3). We will then establish that the optimal allocation can be implemented through trade taxes and characterize the structure of these taxes (Section 4). 8

Home's Planning Problem
Throughout this section we focus on a fictitious environment in which there are no taxes and no competitive markets at home. Rather the domestic government directly controls 6 In other words, we focus on the best-response of the domestic government to zero taxes abroad. We conjecture that many of our qualitative predictions about the domestic government's best-response would extend to other foreign policy vectors, and in turn, apply to the Nash equilibrium of a game in which both countries are strategic. Of course, from a quantitative standpoint, welfare at Home may be much lower in such a Nash equilibrium. 7 An early application of the primal approach in international trade can be found in Baldwin (1948). 8 As will become clear, our main results do not hinge on this particular choice of instruments. We choose to focus on trade taxes-cum-subsidies for expositional convenience because they are the simplest tax instruments required to implement the optimal allocation. It is well known that one could allow for consumption taxes, production taxes, or import tariffs that are not accompanied by export subsidies. One would then find that constraining consumption taxes to be equal to production taxes or import tariffs to be equal to export subsidies, i.e. restricting attention to trade taxes-cum-subsidies, has no effect on the allocation that a welfare-maximizing government would choose to implement. domestic consumption, c, and domestic output, q, subject to the resource constraint, In other words, we ignore the equilibrium conditions associated with utility and profit maximization by domestic consumers and firms; we ignore the government's budget constraint; and we relax the labor market clearing condition into inequality (9). We refer to this relaxed maximization problem as Home's planning problem.
In order to prepare our discussion of optimal trade taxes, we will focus on the foreign wage, w * , net imports m ≡ c − q, and domestic output, q, as the three key control variables of the domestic government. To do so, we first establish that the conditions for an equilibrium in the rest of the world-namely, foreign utility maximization, foreign profit maximization, and good and labor market clearing-can be expressed more compactly as a function of net imports and the foreign wage alone.
According to Lemma 1, when Home's net imports are high, m i + d * i (w * a * i ) > 0, foreign firms produce good i, the world price is determined by their marginal costs, w * a * i , and foreign consumers demand d * i (w * a * i ). 9 Conversely, when Home's net imports are low, m i + d * i (w * a * i ) < 0, foreign firms do not produce good i, foreign consumption is equal to Home's net exports, −m i , and the world price is determined by the marginal utility of the foreign consumer, p i (m i , w * ) = u * i (−m i ) . Equations (13) and (14), in turn, derive from the foreign labor market clearing condition and the foreign consumer's budget constraint.
, and q * (m, w * ) ≡ (q * i (m i , w * )) denote the schedule of equilibrium world prices, foreign consumption, and foreign output as a function of Home's net imports and the foreign wage. Using Lemma 1, we can characterize the set of solutions to Home's planning problem as follows.
The first inequality (15) corresponds to the resource constraint at home and does not merit further comment. The final two inequalities, (16) and (17), are the counterparts of equations (13) and (14) in Lemma 1. One can think of Inequality (17) as Home's trade balance condition. It characterizes the set of feasible net imports. If Home were a small open economy, then it would take p i (m i , w * ) as exogenously given and the solution to (P) would coincide with the free trade equilibrium. Here, in contrast, Home internalizes the fact that net import decisions affect world prices, both directly through their effects on the marginal utility of the foreign consumer and indirectly through their effects on the foreign wage, as reflected in inequality (16).
Two technical aspects of Home's planning problem are worth mentioning at this point. First, in spite of the fact that the foreign consumer's budget constraint and the foreign labor market clearing condition must bind in a competitive equilibrium, as shown in Lemma 1, the solution to Home's planning problem can be obtained as the solution to a new relaxed problem (P) that only features inequality constraints. This will allow us to invoke Lagrangian necessity theorems in Section 3.2. Second, Home's planning problem can be decomposed into an inner and an outer problem. Define W * as the set of values for w * such that there exist import and output levels m, q ≥ 0 that satisfy (15)-(17). The inner problem takes w * ∈ W * as given and maximizes over import and output levels, subject to (15)- (17). The outer problem then maximizes the value function from the inner problem over the foreign wage, max w * ∈W * V(w * ). It is the particular structure of the inner problem (P w * ) that will allow us to make progress in characterizing the optimal allocation. In the next two subsections, we will take the foreign wage w * as given and characterize the main qualitative properties of the solutions to (P w * ). Since such properties will hold for all feasible values of the foreign wage, they will hold for the optimal one, w 0 * ∈ arg max w * ∈W * V(w * ), and so by Lemma 2, they will apply to any solution to Home's planning problem. 10 Of course, for the purposes of obtaining quantitative results we also need to solve for the optimal foreign wage, w 0 * , which we will do in Section 6.
Two observations will facilitate our analysis of the inner problem (P w * ). First, as we will formally demonstrate, (P w * ) is concave, which implies that its solutions can be computed using Lagrange multiplier methods. Second, both the objective function and the constraints in (P w * ) are additively separable in (m i , q i ). In the words of Everett (1963), (P w * ) is a "cell-problem." Using Lagrange multiplier methods, we will therefore be able to transform an infinite dimensional problem with constraints into a series of simple unconstrained, low-dimensional problems.

Lagrangian Formulation
The Lagrangian associated with (P w * ) is given by where λ ≥ 0, λ * ≥ 0, and µ ≥ 0 are the Lagrange multipliers associated with constraints (15)-(17). As alluded to above, a crucial property of L is that it is additively separable in (m i , q i ). This implies that in order to maximize L with respect to (m, q), one simply needs 10 This is a key technical difference between our approach and the approaches used in Amador et al. (2006), Amador and Bagwell (2013), and Costinot et al. (2013). The basic strategy here does not consist in showing that the maximization problem of interest can be studied using general Lagrange multiplier methods. Rather, the core of our approach lies in finding a subproblem to which these methods can be applied. Section 5 illustrates the usefulness of this approach by showing how our results can easily be extended to environments with non-CES utility and arbitrary neoclassical production functions.
to maximize the good-specific Lagrangian, with respect to (m i , q i ) for almost all i. In short, cell problems can be solved cell-by-cell, or in the present context, good-by-good. Building on the previous observation, the concavity of (P w * ), and Lagrangian necessity and sufficiency theorems-Theorem 1, p. 217 and Theorem 1, p. 220 in Luenberger (1969), respectively-we obtain the following characterization of the set of solutions to (P w * ).
Let us take stock. We started this section with Home's planning problem, which is an infinite dimensional problem in consumption and output in both countries as well as world prices and the foreign wage. By expressing world prices, foreign consumption and foreign output as a function of net imports and the foreign wage (Lemma 1), we then transformed it into a new planning problem (P) that only involves the schedule of domestic net imports, m, domestic output, q, and the foreign wage, w * , but remains infinitely dimensional (Lemma 2). Finally, in this subsection we have taken advantage of the concavity and the additive separability of the inner problem (P w * ) in (m i , q i ) to go from one high-dimensional problem with constraints to many two-dimensional, unconstrained maximization problems (P i ) using Lagrange multiplier methods (Lemma 3).
The goal of the next subsection is to solve these two-dimensional problems in (m i , q i ) taking the foreign wage, w * , and the Lagrange multipliers, (λ, λ * , µ), as given. This is all we will need to characterize qualitatively how comparative advantage affects the solution of Home's planning problem and, as discussed in Section 4, the structure of optimal trade taxes. Once again, a full computation of optimal trade taxes will depend on the equilibrium values of (λ, λ * , µ), found by using the constraints (15)-(17) and the value of w * that maximizes V(w * ), calculations that we defer until Section 6.

Optimal Output and Net Imports
Our objective here is to find the solution m 0 While the economic intuition underlying our results will become transparent once we reintroduce trade taxes in Section 4, we focus for now on the simple maths through which We proceed in two steps. First, we solve for the output level q 0 The optimal output level is then simply given by q 0 is strictly concave and differentiable in q i , the optimal output level, q 0 i (m i ), is given by the necessary and sufficient first-order condition, The previous condition can be rearranged in a more compact form as Note that the domestic resource constraint (15) must be binding at any solution of (P w * ). Otherwise the domestic government could strictly increase utility by increasing output. Thus λ must be strictly positive by Lemma 3, which implies that q 0 i (m i ) is well-defined. Let us now turn to our second Lagrangian problem, finding the value of m i that maximizes L i m i , q 0 i (m i ) , λ, λ * , µ; w * . The same arguments as in the proof of Lemma 3 imply that the previous Lagrangian is concave in m i with a kink at m i = M I i ≡ −d * i (w * a * i ) < 0, when Foreign starts producing good i; see equation (12). Accordingly, we cannot search for maxima of L i m i , q 0 i (m i ) , λ, λ * , µ; w * by looking for stationary points. But this technicality is of little consequence for our approach, the end goal of which is the maximization of the Lagrangian with respect to m i , not the location of its stationary points.
To study how L i m i , q 0 i (m i ) , λ, λ * , µ; w * varies with m i , we consider three regions separately: When the previous inequality is satisfied, the concavity of L i implies that Home exports m I i units of good i, as illustrated in Figure 1a, whereas Foreign does not produce anything.
Second, suppose that m i ∈ M I i , M I I i . In this region, equations (10), (12), and (18) imply . When a i a * i ∈ A I , A I I , the concavity of L i implies that Home will export M I i units of good i, as illustrated in Figure 1b. For these goods, Foreign is at a tipping point: it would start producing if Home's exports were to go down by any amount. In the knife-edge case, a i a * i = A I I , the Lagrangian is flat between M I i and M I I i so that any import level between M I i and M I I i is optimal, as illustrated in Figure 1c. In this situation, either Home or Foreign may produce and export good i. Finally, suppose that M I I i ≤ m i . In this region, equations (10), (12), and (18) imply When this inequality is satisfied, the concavity of L i implies that Home will import m I I i units of good i, as illustrated in Figure 1d. We summarize the above observations in the following proposition. Proposition 1 highlights the importance of comparative advantage, i.e., the crosssectoral variation in the relative unit labor requirement a i /a * i , for the structure of optimal imports. Recall that m I Thus Proposition 1 implies that Home is a net exporter of good i, m 0 i < 0, only if a i /a * i ≤ A I I . Using Lemmas 2 and 3 to go from (P i ) to Home's planning problem, this leads to the following corollary.
Corollary 1. At any solution to Home's planning problem, Home produces and exports goods in which it has a comparative advantage, a i /a * i < A I I , whereas Foreign produces and exports goods in which it has a comparative advantage, a i /a * i > A I I .
According to Corollary 1, there will be no pattern of comparative advantage reversals at an optimum. Like in a free trade equilibrium, there exists a cut-off such that Home exports a good only if its relative unit labor requirement is below the cut-off. Of course, the value of that cut-off as well as the export levels will, in general, be different from those in a free trade equilibrium.

Optimal Trade Taxes
We now demonstrate how to implement the solution of Home's planning problem using trade taxes in a competitive equilibrium.

Wedges
Trade taxes cause domestic and world prices to differ from one another. To prepare our analysis of optimal trade taxes, we therefore start by describing the wedges, τ 0 i , between the marginal utility of the domestic consumer, , and the world price, p 0 i , that must prevail at any solution to Home's planning problem: By Lemma 1, we know that if w 0 * , p 0 , c 0 , c 0 * , q 0 , q 0 * solves Home's planning problemand hence satisfies conditions (5)-(8)-then p 0 i = p i m 0 i , w 0 * . By Lemma 2, we also know that if w 0 * , p 0 , c 0 , c 0 * , q 0 , q 0 * solves Home's planning problem, then w 0 * , m 0 = c 0 − q 0 , q 0 solves (P). In turn, this implies that m 0 = c 0 − q 0 , q 0 solves (P w * ) for w * = w 0 * , and by Lemma 3, that m 0 i , q 0 i solves (P i ) for almost all i. Accordingly, the good-specific wedge can be expressed as (10) and (18) Since A I < A I I , we see that good-specific wedges are (weakly) increasing with a i /a * i . For goods that are exported, a i /a * i < A I I , the magnitude of the wedge depends on the strength of Home's comparative advantage. It attains its minimum value, σ * −1 σ * µ 0 − 1, for goods such that a i /a * i < A I and increases linearly with a i /a * i for goods such that a i /a * i ∈ (A I , A I I ). For goods that are imported, a i /a * i > A I I , wedges are constant and equal to their maximum value, λ 0 * w 0 * + µ 0 − 1.

Comparative Advantage and Trade Taxes
Let us now demonstrate that any solution w 0 * , p 0 , c 0 , c 0 * , q 0 , q 0 * to Home's planning problem can be implemented by constructing a schedule of trade taxes, t 0 = τ 0 , and a lump-sum transfer, T 0 =´i p i τ 0 i m 0 i di. Since the domestic government's budget constraint is satisfied by construction and the resource constraint (9) must bind at any solution to Home's planning problem, equations (3) and (4) trivially hold. Thus we only need to check that we can find a domestic wage, w 0 , such that the conditions for utility and profit maximization by domestic consumers and firms at distorted local prices p 0 i 1 + t 0 i , i.e., conditions (1) and (2), are satisfied as well.
Consider first the problem of a domestic firm. At a solution to Home's planning problem, we have already argued in Section 3.3 that for almost all i, By definition of τ 0 , we also know that This implies that condition (2) is satisfied, with the domestic wage in the competitive equilibrium given by the Lagrange multiplier on the labor resource constraint, w 0 = λ 0 . Let us turn to the domestic consumer's problem. By definition of τ 0 , if t 0 Thus for any pair of goods, i 1 and i 2 , we have Hence, the domestic consumer's marginal rate of substitution is equal to the domestic relative price. By Lemma 1, we know that trade must be balanced at a solution to Home's planning problem,´i p 0 Since conditions (4) and (21) (23) implies that the domestic consumer's budget constraint must hold for w 0 = λ 0 . Combining this observation with equation (22), we can conclude that condition (1) must hold as well.
At this point, we have established that any solution w 0 * , p 0 , c 0 , c 0 * , q 0 , q 0 * to Home's planning problem can be implemented by constructing a schedule of trade taxes, t 0 = τ 0 , and a lump-sum transfer, T 0 =´i p i τ 0 i m 0 i di. Since Home's planning problem, as described in Definition 3, is a relaxed version of the domestic government's problem, as described in   Definition 2, this immediately implies that t 0 , T 0 , w 0 , w 0 * , p 0 , c 0 , c 0 * , q 0 , q 0 * is a solution to the original problem. Conversely, suppose that t 0 , T 0 , w 0 , w 0 * , p 0 , c 0 , c 0 * , q 0 , q 0 * is a solution to the domestic's government problem, then w 0 * , p 0 , c 0 , c 0 * , q 0 , q 0 * must solve Home's planning problem and, by condition (1), the optimal trade taxes t 0 must satisfy with ν > 0 the Lagrange multiplier on the domestic consumer's budget constraint. By equation (19), this implies that 1 + t 0 i = 1 ν (1 + τ 0 i ). Combining this observation with equation (20), we obtain the following characterization of optimal trade taxes.
Proposition 2. At any solution of the domestic government's problem, trade taxes, t 0 , are such that: (a) t 0 i = (1 +t) ( Proposition 2 states that optimal trade taxes vary with comparative advantage as wedges do. Trade taxes are at their lowest values, (1 +t) (A I /A I I ) − 1, for goods in which Home's comparative advantage is the strongest, a i /a * i < A I ; they are linearly increasing with a i /a * i for goods in which Home's comparative advantage is in some intermediate range, a i /a * i ∈ A I , A I I ; and they are at their highest value,t, for goods in which Home's comparative advantage is the weakest, a i /a * i > A I I . Since only relative prices and hence relative taxes matter for domestic consumers and firms, the overall level of taxes is indeterminate. This is an expression of Lerner symmetry, which is captured by the free parametert > −1 in the previous proposition. Figure 2 illustrates two polar cases. In Figure 2a, there are no import tariffs,t = 0, and all exported goods are subject to an export tax that rises in absolute value with comparative advantage. In Figure 2b, in contrast, all imported goods are subject to a tarifft = A I I A I − 1 ≥ 0, whereas exported goods receive a subsidy that falls with comparative advantage. For expositional purposes, we focus in the rest of our discussion on the solution with zero import tariffs, t = 0, as in Figure 2a.
To gain intuition about the economic forces that shape optimal trade taxes, consider first the case in which foreign preferences are Cobb-Douglas, σ * = 1, as in Dornbusch et al. (1977). In this case, A I = 0 so that the first region, a i /a * i < A I , is empty. In the second region, a i /a * i ∈ A I , A I I , there is limit pricing: Home exports the goods and sets export taxes t 0 i <t = 0 such that foreign firms are exactly indifferent between producing and not producing those goods, i.e., such that the world price satisfies p 0 The less productive are foreign firms relative to domestic firms, the more room Home has to manipulate prices, and the bigger the export tax is (in absolute value). Finally, in the third region, a i /a * i > A I I , relative prices are pinned down by the relative unit labor requirements in Foreign. Since Home has no ability to manipulate these relative prices, a uniform import tariff (here normalized to zero) is optimal.
In the more general case, σ * ≥ 1, as in Wilson (1980), Eaton and Kortum (2002), and Alvarez and Lucas (2007), the first region, a i /a * i < A I , is no longer necessarily empty. The intuition, however, remains simple. In this region the domestic government has incentives to charge a constant monopoly markup, proportional to σ * /(σ * − 1). Specifically, the ratio between the world price and the domestic price is equal to 1/(1 + t 0 i ) = σ * σ * −1 ν µ 0 . In the region a i /a * i ∈ A I , A I I , limit pricing is still optimal. But because A I is increasing in σ * , the extent of limit pricing, all else equal, decreases with the elasticity of demand in the foreign market.

Discussion
Proposition 2 accords well with the observation that governments often protect a small number of less competitive industries. Yet in our model, such targeted subsidies do not stem from a greater desire to expand production in these sectors. On the contrary, they reflect tighter constraints on the ability to exploit monopoly power by contracting exports. According to Proposition 2, Home can only charge constant monopoly markups for exported goods in which its comparative advantage is the strongest. For other exported goods, the threat of entry of foreign firms leads markups to decline together with Home's comparative advantage.
An interesting issue is whether the structure of optimal trade taxes described in Proposition 2 crucially relies on the assumption that domestic firms are perfectly competitive. Since Home's government behaves like a domestic monopolist competing à la Bertrand against foreign firms, one may conjecture that if each good were produced by only one domestic firm, then Home would no longer have to use trade taxes to manipulate prices: domestic firms would already manipulate prices under laissez-faire. This conjecture, however, is incorrect for two reasons.
The first reason is that although the government behaves like a monopolist, the domestic government's problem involves non-trivial general equilibrium considerations. Namely, it internalizes the fact that by producing more goods at home, it lowers foreign labor demand, which must cause a decrease in the foreign wage and an improvement of Home's terms-of-trade. These considerations are captured by the foreign resource constraint (16) in Home's planning problem. As we discuss in more details in Section 6.1, provided that the Lagrange multiplier associated with that constraint, λ 0 * , is not zero, the optimal level of the markup charged by the domestic government will be different from what an individual firm would have charged, i.e., σ * / (σ * − 1). In our quantitative exercises, such general-equilibrium considerations have small effects on optimal taxes.
The second reason is that to manipulate prices, Home's government needs to affect the behaviors of both firms and consumers: net imports depend both on supply and demand. If each good were produced by only one domestic firm, Home's government would still need to impose good-varying consumption taxes that mimic the trade taxes described above (plus output subsidies that reflect general equilibrium considerations). Intuitively, if each good were produced by only one domestic firm, consumers would face monopoly markups in each country, whereas optimality requires a wedge between consumer prices at home and abroad.
As mentioned in the Introduction, our findings are related to the results of Itoh and Kiyono (1987). They have shown that in the Ricardian model with Cobb-Douglas preferences considered by Dornbusch et al. (1977), export subsidies may be welfare enhancing. A key feature of the welfare-enhancing subsidies that they consider is that they are not uniform across goods; instead, they are concentrated on "marginal" goods. This is consistent with our observation that, at the optimum, export taxes should be weakly decreasing (in absolute value) with Home's relative unit labor requirements, a i /a * i , so that "marginal" goods should indeed be taxed less. The economic forces behind their results, however, are orthogonal to those emphasized in Proposition 2. Their results reflect the general-equilibrium considerations alluded to above: by expanding the set of goods produced at home, the domestic government can lower the foreign wage and improve its terms-of-trade. In contrast, the heterogeneity of taxes across goods in Proposition 2 derives entirely from the structure of the inner problem (P w * ), which takes the foreign wage as given. This implies, in particular, that Proposition 2 would still hold if Home were a "small" country in the sense that it could not affect the foreign wage. 11

Robustness
In this section we incorporate general preferences, general technology, as well as trade costs into the Ricardian model presented in Section 2. Our goal is twofold. First, we want to demonstrate that Lagrange multiplier methods, and in particular our strategy of identifying concave cell-problems, remain well suited to analyzing optimal trade policy in these alternative environments. Second, we want to explore the extent to which the predictions derived in Section 4 hinge on the assumption of CES utility, the fact that comparative advantage derives from differences in technologies alone, or the absence of trade costs. To save on space, we focus on sketching alternative environments and summarizing their main implications.

Preferences
While the assumption of CES utility is standard in the Ricardian literature-from Dornbusch et al. (1977) to Eaton and Kortum (2002)-it implies strong restrictions on the demand-side of the economy: own-price elasticities and elasticities of substitution are both constant and pinned down by a single parameter, σ. In practice, price elasticities may vary with quantities consumed and substitution patterns may vary across goods.
Here we relax the assumptions of Section 2 by assuming (i) that Home's preferences are weakly separable over a discrete number of sectors, s ∈ S ≡ {1, ..., S}, and (ii) that subutility within each sector, U s , is additively separable, though not necessarily CES. Specifically, we assume that Home's preferences can be represented by the following utility function, where F is a strictly increasing function; c s ≡ (c i ) i∈I s is the consumption of goods in 11 The observation that optimal trade policy may not converge towards zero as the economy becomes arbitrarily small is related to the point made by Gros (1987) in a monopolistically competitive model and Alvarez and Lucas (2007) in a Ricardian model. sector s, with I s the set of goods that belongs to that sector; and U s is such that Foreign's preferences are similar, and asterisks denote foreign variables. Section 2 corresponds to the special case in which there is only one sector, S = 1, and U s is CES, . 12 For expositional purposes, let us start by considering an intermediate scenario in which utility is not CES while maintaining the assumption that there is only one sector, S = 1. It should be clear that the CES assumption is not crucial for the results derived in Sections 2.2-3.2. In contrast, CES plays a key role in determining the optimal level of net imports, m I , in Section 3.3 and, in turn, in establishing that trade taxes are at their lowest values, (1 +t) (A I /A I I ) − 1, for goods in which Home's comparative advantage is the strongest in Section 4.2. Absent CES utility, trade taxes on imported goods would still be uniform, but trade taxes on exported goods, like the optimal monopoly markup, would now also vary with the elasticity of demand. Now let us turn to the general case with multiple sectors, S ≥ 1. With weakly separable preferences abroad, one can check that foreign consumption in each sector, c s * ≡ c * i i∈I s , must be such that c s * ∈ argmaxc ≥0 U s * (c)|´i ∈I s p s ic i di ≤ E s * , Accordingly, by the same argument as in Lemma 1, we can write the world price and foreign output for all s ∈ S and i ∈ I s as and where ν (E s * ) is the Lagrange multiplier associated with the constraint,´i ∈I s p s ic i di ≤ E s * . In this situation, Home's planning problem can still be decomposed into an outer problem and multiple inner problems, one for each sector. At the outer level, the government now chooses the foreign wage, w * , together with the sectoral labor allocations in Home and Foreign, L s and L s * , and the sectoral trade deficits, D s , subject to aggregate factor market clearing and trade balance. At the inner level, the government treats L s , L s * , D s , and w * as constraints and maximizes subutility sector-by-sector. More precisely, Home's planning problem can be expressed as where the sector-specific value function is now given by Given equations (24) and (25), the sector-specific maximization problem is of the same type as in the baseline case (program P). As in Section 3.2, we can therefore reformulate each infinite-dimensional sector-level problem into many two-dimensional, unconstrained maximization problems using Lagrange multiplier methods. Within any sector with CES utility, all of our previous results hold exactly. Within any sector in which utility is not CES, our previous results continue to hold subject to the qualification about monopoly markups discussed above.

Technology
As is well known, the Ricardian model can always be interpreted as a neoclassical model with multiple factors of production under the restriction that all goods use factors of production in the same proportions. In practice, however, factor intensities do differ across sectors. Thus, relative production costs depend not only on productivity differences-as in our baseline model-but also on factor intensities and factor prices. Here we generalize the model of Section 2.1 to allow for arbitrary neoclassical production functions. In spite of the generality of this new environment, we find that our main prediction survives: due to limit pricing, taxes remain weakly monotone with respect to relative cost across exported goods.
The new environment can be described as follows. There are multiple factors of production indexed by n, each of which are perfectly mobile across goods and immobile across countries. We now denote by L ≡ (L n ) ≥ 0 the exogenous vector of factor endowments at home. Production of each good is subject to constant returns to scale. If l i ≡ (l in ) units of each factor are employed in sector i at home or abroad, then total output is given by f i (l i ) or f * i (l i ). The Ricardian model considered in Section 2.1 corresponds to the special case in which f i (l i ) = l i /a i .
The competitive equilibrium can still be described as in Section 2.2. Besides the fact that multiple factor markets must now clear at home and abroad, the only additional equilibrium condition is that firms must choose unit factor requirements to minimize their costs, where w ≡ (w n ) is now the vector of factor prices and · denotes the scalar product. A similar condition holds abroad, with asterisks denoting foreign factor prices and foreign production functions.
Regarding Home's planning problem, the same argument as in Lemma 1 implies that the world price, foreign consumption, foreign unit factor requirements, and foreign production can be expressed more compactly as functions of net imports and foreign factor prices alone. Similarly, Home's planning problem can still be decomposed into an outer problem and an inner problem. At the inner level, the government treats the vector of foreign factor prices, w * ≡ (w * n ), as given and chooses net imports and output, m, q ≥ 0, as well as domestic unit factor requirements, a ≥ 0. At the outer level, the government then chooses the vector of foreign factor prices, w * . Using the same approach as in Section 3.2 and substituting for the optimal unit factor requirements, we can then reduce Home's Problem to maximizing with respect to (m i , q i ) the good-specific Lagrangian, where λ ≡ (λ n ) and λ * ≡ (λ * n ) now denote the vectors of Lagrange multipliers associated with the domestic and foreign resource constraints, respectively.
Solving for optimal output and net imports follows similar arguments as in Section 3.3. First, we find optimal output, q 0 i (m i ), as a function of net imports. Second, we find the value of m i that maximizes L i . As in the baseline model, the Lagrangian has two kinks. The first one occurs at m i = M I i ≡ −d * i w * · a * i (w * ) < 0, when Foreign starts producing good i, and the second occurs at m i = M I I i ≡ d i (λ · a i (λ)) > 0, when Home stops producing good i. Letting γ i ≡ λ · a i (λ) and γ * i ≡ w * · a * i (w * ) denote the unit costs of production in the two countries and considering separately the three regions partitioned by the two kinks, we obtain the following generalization of Proposition 1.
Proposition 3. Optimal net imports are such that: (a) m 0 Starting from Proposition 3 and using the same arguments as in Section 4.1, one can show that wedges should be constant and equal to σ * −1 σ * µ − 1 in Region (a) and linear in . This implies that optimal taxes on exported goods should be constant for goods in which Home's relative cost is the lowest (Region a) and monotone in relative costs for other goods (Region b). Like in our baseline Ricardian model, the previous monotonic relationship reflects the constraints on the ability of the domestic government to manipulate world prices in that region.
Proposition 3, however, differs from Proposition 1 in two important respects. First, it establishes a relationship between imports and relative costs, not a relationship between imports and comparative advantage. Since unit costs of production-unlike unit labor requirements in a Ricardian model-are endogenous objects, it is a priori possible that no goods may fall into Regions (a), (b), and (d). 13 An important question, therefore, is whether there are other canonical models for which Proposition 3 can be re-stated in terms of primitive assumptions about technology and factor endowments. Another prominent example for which this is the case is the Heckscher-Ohlin model considered by Dornbusch et al. (1980). In an economy with a continuum of goods, CES utility, two factors (capital and labor), and identical technologies across countries, one can show that at the solution of the planning problem, the capital-abundant country should have relatively lower costs in the capital-intensive sectors. Accordingly, optimal taxes should be constant on the most capital-intensive goods and monotone in capital intensity for other exported goods, i.e. monotone in comparative advantage.
The second difference between Propositions 1 and 3 is more subtle and relates to optimal taxes on imported goods. Compared to the baseline Ricardian model, the domestic government may now manipulate the relative price of its imports. In the Ricardian model, those relative prices were pinned down by relative unit labor requirements abroad. In this more general environment, the domestic government may affect the relative price of its imports by affecting relative factor demand abroad and, in turn, relative factor prices. Whenever the vector of Lagrange multipliers associated with the foreign resource constraint, λ * , is not collinear with the vector of foreign factor prices, w * , it will have incentives to do so, thereby leading to taxes on imported goods that may now vary across goods.
Based on the quantitative results presented in Section 6, we expect the manipulation of relative factor demand abroad to be relatively unimportant in practice. Even when considering a country as large as the United States, we find that λ * is close to zero. This is suggestive of most countries being "small" in the sense that they cannot affect factor market clearing conditions in the rest of the world. Yet, as our analysis demonstrates, this does not imply that most countries would not want to manipulate world prices to their advantage. Even if λ * is equal to zero-so that λ * is trivially collinear with w * -Proposition 3 shows that a small, but strategic country would like to impose taxes on exported goods that are weakly monotone in relative costs. Put differently, whereas the ability to affect factor prices in the rest of the world clearly depends on country size, the incentives for limit pricing do not.

Trade Costs
Trade taxes are not the only forces that may cause domestic and world prices to diverge.
Here we extend our model to incorporate exogenous iceberg trade costs, δ ≥ 1, such that if 1 unit of good i is shipped from one country to another, only a fraction 1/δ arrives. In the canonical two-country Ricardian model with Cobb-Douglas preferences considered by Dornbusch et al. (1977), these costs do not affect the qualitative features of the equilibrium beyond giving rise to a range of commodities that are not traded. We now show that similar conclusions arise from the introduction of trade costs in our analysis of optimal trade policy.
We continue to define world prices, p i , as those prevailing in Foreign and let denote the gap between domestic and world prices in the absence of trade taxes. As in our benchmark model, the domestic government's problem can be reformulated and transformed into many two-dimensional, unconstrained maximization problems using Lagrange multiplier methods. In the presence of trade costs, Home's objective is to find the solution m 0 i , q 0 i of the good-specific Lagrangian, where p i (m i , w * ) and q * i (m i , w * ) are now given by Compared to the analysis of Section 3, if Home exports −m i > 0 units abroad, then Foreign only consumes −m i /δ units. Conversely, if Home imports m i > 0 units from abroad, then Foreign must export m i δ units. This explains why φ (m i ) appears in the two previous expressions. The introduction of transportation costs leads to a new kink in the good-specific Lagrangian. In addition to the kink at m i = δM I i ≡ −δd * i (w * a * i ), there is now a kink at m i = 0, reflecting the fact that some goods may no longer be traded at the solution of Home's planning problem. As before, since we are not looking for stationary points, this technicality does not complicate our problem. When maximizing the good-specific Lagrangian, we simply consider four regions in m i space: m i < δM I i , δM I i ≤ m i < 0, 0 ≤ m i < M I I i , and m i ≥ M I I i . As in Section 3, if Home's comparative advantage is sufficiently strong, a i /a * i ≤ 1 Similarly, if Foreign's comparative advantage is sufficiently strong, a i /a * i > δA I I ≡ δ λ * +µw * λ , then optimal net imports are m 0 Relative to the benchmark model, there is now a range of goods for which comparative advantage is intermediate, a i /a * i ∈ 1 δ A I I , δA I I , in which no international trade takes place. For given values of the foreign wage, w * , and the Lagrange multipliers, λ, λ * , µ, this region expands as trade costs become larger, i.e., as δ increases.
Building on the previous observations, we obtain the following generalization of Proposition 1.
Proposition 4. Optimal net imports are such that: (a) m 0 Using Proposition 4, it is straightforward to show, as in Section 4.1, that wedges across traded goods are (weakly) increasing with Home's comparative advantage. Similarly, as in Section 4.2, one can show that any solution to Home's planning problem can be implemented using trade taxes and that the optimal taxes vary with comparative advantage as wedges do. In summary, our main theoretical results are also robust to the introduction of exogenous iceberg trade costs.

Applications
To conclude, we apply our theoretical results to two sectors: agriculture and manufacturing. Our goal is to take a first look at the quantitative importance of optimal trade taxes for welfare, both in an absolute sense and relative to the simpler case of uniform import tariffs.
In both applications, we compute optimal trade taxes as follows. First, we use Proposition 1 to solve for optimal imports and output given arbitrary values of the Lagrange multipliers, (λ, λ * , µ), and the foreign wage, w * . Second, we use constraints (15)-(17) to solve for the Lagrange multipliers. Finally, we find the value of the foreign wage that maximizes the value function V(w * ) associated with the inner problem. Given the optimal foreign wage, w 0 * , and the associated Lagrange multipliers, λ 0 , λ 0 * , µ 0 , we finally compute optimal trade taxes using Proposition 2.

Agriculture
In many ways, agriculture provides an ideal environment in which to explore the quantitative importance of our results. From a theoretical perspective, the market structure in this sector is arguably as close as possible to the neoclassical ideal. And from a measurement perspective, the scientific knowledge of agronomists provides a unique window into the structure of comparative advantage, as discussed in Costinot and Donaldson (2011). Finally, from a policy perspective, agricultural trade taxes are pervasive and one of the most salient and contentious global economic issues, as illustrated by the World Trade Organization's current, long-stalled Doha round.
Calibration. We start from the Ricardian economy presented in Section 2.1 and assume that each good corresponds to one of 39 crops for which we have detailed productivity data, as we discuss below. All crops enter utility symmetrically in all countries, β i = β * i = 1, and with the same elasticity of substitution, σ = σ * . Home is the United States and Foreign is an aggregate of the rest of the world (henceforth R.O.W.). The single factor of production is equipped land. We also explore how our results change in the presence of exogenous iceberg trade costs, as in Section 5.3.
The parameters necessary to apply our theoretical results are: (i) the unit factor requirement for each crop in each country, a i and a * i ; (ii) the elasticity of substitution, σ; (iii) the relative size of the two countries, L * /L; and (iv) trade costs, δ, when relevant. For setting each crop's unit factor requirements, we use data from the Global Agro-Ecological Zones (GAEZ) project from the Food and Agriculture Organization (FAO); see Costinot and Donaldson (2011). Feeding data on local conditions-e.g., soil, topography, elevation and climatic conditions-into an agronomic model, scientists from the GAEZ project have computed the yield that parcels of land around the world could obtain if they were to grow each of the 39 crops we consider in 2009. 1415 We set a i and a * i equal to the average hectare per ton of output across all parcels of land in the United States and R.O.W., respectively.
The other parameters are chosen as follows. We set σ = 2.9 in line with the median estimate of the elasticity of substitution across our 39 crops in Broda and Weinstein (2006). 16 We set L = 1 and L * = 10.62 to match the relative acreage devoted to the 39 crops considered, as reported in the FAOSTAT data in 2009. Finally, in the extension with trade costs, we set δ = 1.72 so that Home's import share in the equilibrium without trade policy matches the U.S. agriculture import share-that is, the total value of U.S. imports over the 39 crops considered divided by the total value of U.S. expenditure over those same crops-in the FAOSTAT data in 2009, 11.1%. Figure 3 report optimal trade taxes on all traded crops i as a function of comparative advantage, a i /a * i , in the calibrated examples without trade costs, δ = 1, and with trade costs, δ = 1.72, respectively. 17 The region between 14 While there are 43 crops in the original GAEZ database, we collapse this to 39 because of our need to merge the GAEZ crops with those in the FAOSTAT data (on trade flows and land usage). In doing so, we combine wetland rice and dryland rice, pearl millet and foxtail millet, and phaseolus bean and gram, in each case taking the maximum predicted GAEZ yield as the yield of the combined crop. In addition, we dropped jatropha from the analysis because this crop is not tracked in the FAOSTAT data. 15 The GAEZ project constructs output per hectare predictions under different assumptions on a farmer's use of complementary inputs (e.g. irrigation, fertilizers, and machinery). We use the measure that is constructed under the assumption that irrigation and a "moderate" level of other inputs (fertilizers, machinery, etc.) are available to farmers. 16 The elasticity of substitution estimated by Broda and Weinstein (2006) are available for 5-digit SITC sectors. When computing the median across our 39 crops, we restrict ourselves to 5-digit SITC codes that can be matched to raw versions of the 39 FAO crops. 17 We compute optimal trade taxes, throughout this and the next subsection, by performing a grid search the two vertical lines in the right panel corresponds to goods that are not traded at the solution of Home's planning problem. As discussed in Section 4.2, the overall level of taxes is indeterminate. Figure 3 focuses on a normalization with zero import tariffs. In both cases, the maximum export tax is close to the optimal monopoly markup that a domestic firm would have charged on the foreign market, σ/ (σ − 1) − 1 52.6%. The only difference between the two markups comes from the fact that the domestic government internalizes the effect that the net imports of each good have on the foreign wage. Specifically, if the Lagrange multiplier on the foreign resource constraint, λ 0 * , were equal to zero, then the maximum export tax, which is equal A I /A I I − 1, would simplify to the firm-level markup, σ/ (σ − 1) − 1. In other words, such general equilibrium considerations appear to have small effects on the design of optimal trade taxes for goods in which the U.S. comparative advantage is the strongest. In light of the discussion in Section 4.3, these quantitative results suggest that if domestic firms were to act as monopolists rather than take prices as given, then the domestic government could get close to the optimal allocation by only using consumption taxes that mimic the optimal trade taxes.

Results. The left and right panels of
The first and second columns of Table 1 display U.S. and R.O.W. welfare gains from trade, i.e. the percentage change in total income divided by the CES price index relaover the foreign wage w * so as to maximize V(w * ). Since Foreign cannot be worse off under trade than under autarky-whatever world prices may be, there are gains from trade-and cannot be better off than under free trade-since free trade is a Pareto optimum, Home would have to be worse off-we restrict our grid search to values of the foreign wage between those that would prevail in the autarky and free trade equilibria. Recall that we have normalized prices so that the Lagrange multiplier associated with the foreign budget constraint is equal to one. Thus w * is the real wage abroad. 0.96), both relative to the laissez-faire case. This suggests large inefficiencies from terms-of-trade manipulation at the world level. Interestingly, we also see that more than half of the previous U.S. gains arise from the use of non-uniform trade taxes since a uniform tariff would increase U.S. gains by only 9% (42.60/39.15 − 1 0.09).
The third and fourth columns of Table 1 revisit the previous three scenarios using the model with trade costs, setting δ = 1.72. Not surprisingly, as the U.S. import shares goes down from around 80% in the model without trade costs to its calibrated value of 11.1% in the model with trade costs, gains from trade also go down by an order of magnitude, from 39.15% to 5.02%. Yet, the relative importance of trade taxes that vary with comparative advantage remains fairly stable. Even with trade costs, gains from trade for the United States are 14% larger under optimal trade taxes than in the absence of any trade taxes (5.71/5.02 − 1 0.14) and, again, slightly more than half of these gains arise from the use of non-uniform trade taxes (5.44/5.02 − 1 0.08).

Manufacturing
There are good reasons to suspect that the quantitative results from Section 6.1 may not generalize to other tradable sectors. In practice, most traded goods are manufactured goods and the pattern of comparative advantage within those goods may be very different than within agricultural products. We now explore the quantitative importance of such considerations.
Calibration. As in the previous subsection, we focus on the baseline Ricardian economy presented in Section 2.1 and the extension to iceberg trade costs presented in Section 5.3. Home and Foreign still correspond to the United States and R.O.W., respectively, but we now assume that each good corresponds to one of 400 manufactured goods that are produced using equipped labor. 19 Compared to agriculture, the main calibration issue is how to set unit factor requirements. Since one cannot measure unit factor requirements directly for all manufactured goods in all countries, we follow the approach pioneered by Eaton and Kortum (2002) and assume that unit factor requirements are independently drawn across countries and goods from an extreme value distribution whose parameters can be calibrated to match a few key moments in the macro data. In a two-country setting, Dekle et al. (2007) have shown that this approach is equivalent to assuming with θ the shape parameter of the extreme value distribution, that is assumed to be common across countries, and T and T * the scale parameters, that are allowed to vary across countries. The goods index i is equally spaced between 1/10, 000 and 1 − 1/10, 000 for the 400 goods in the economy. Given the previous functional form assumptions, we choose parameters as follows. We set σ = 2.5 to match the median estimate of the elasticity of substitution among 5digit SITC manufacturing sectors in Broda and Weinstein (2006), which is very close to the value used in the agricultural exercise. 20 We set L = 1 and L * = 19.2 to match population in the U.S. relative to R.O.W., as reported in the 2013 World Development Indicators for 2009. Since the shape parameter θ determines the elasticity of trade flows with respect to trade costs, we set θ = 5, which is a typical estimate in the literature; see e.g. Anderson and Van Wincoop (2004) and Head and Mayer (2013). Given the previous parameters, we then set T = 5, 194.8 and T * = 1 so that in the equilibrium without trade policy Home's share of world GDP matches the U.S. share, 26.2%, as reported in the World Development Indicators for 2009. Finally, in the extension with trade costs, we now set δ = 1.44 so that Home's import share in the equilibrium without trade policy matches the U.S. manufacturing import share-i.e., total value of U.S. manufacturing imports divided 19 The number of goods is chosen to balance computational burden against distance between our model and models with a continuum of goods such as Eaton and Kortum (2002). We find similar results with other numbers of goods. 20 SITC manufacturing sectors include "Manufactured goods classified chiefly by material," "Machinery and transport equipment," and "Miscellaneous manufactured articles." Results. Figure 4 reports optimal trade taxes as a function of comparative advantage for manufacturing. As before, the left and right panels correspond to the models without and with trade costs, respectively, under a normalization with zero import tariffs. Like in the agricultural exercise of Section 6.1, we see that the maximum export tax is close to the optimal monopoly markup that a domestic firm would have charged on the foreign market, σ/ (σ − 1) − 1 66.7%, suggesting that the U.S. remains limited in its ability to manipulate the foreign wage. Table 2 displays welfare gains in the manufacturing sector. In the absence of trade costs, as shown in the first two columns, gains from trade for the U.S. are 33% larger under optimal trade taxes than in the absence of any trade taxes (36.85/27.70 − 1 0.33) and 86% smaller for the R.O.W. (1 − 0.93/6.59 0.86). This again suggests large inefficiencies from terms-of-trade manipulation at the world level. Compared to our agricultural exercise, the share of the U.S. gains arising from the use of non-uniform trade taxes is now even larger: more than two thirds (30.09/27.70 − 1 0.09 as compared to 0.33).
As in Section 6.1, although the gains from trade are dramatically reduced by trade costs-they go down to 6.18% and 2.02% for the U.S. and the R.O.W, respectively-the importance of non-uniform trade taxes relative to uniform tariffs remains broadly stable. In the presence of trade costs, gains from trade for the U.S., reported in the third column, are 49% larger under optimal trade taxes than in the absence of any trade taxes (9.21/6.18 − 1 0.49), and more than half of these gains (since 7.31/6.18 − 1 0.18) arise   Arkolakis et al. (2012), the present results speak well to the importance of micro-level heterogeneity for the design of and gains from trade policy. In this example, the functional form assumption imposed on the distribution of unit labor requirements-equation (29)-implies that the model satisfies a gravity equation, as in Eaton and Kortum (2002). Conditional on matching the same trade elasticity and observed trade flows, the welfare changes associated with any uniform trade tax would be the same as in a simple Armington or Krugman (1980) model. 21 This equivalence is reflected in the fact that the optimal uniform tariff in the present example is equal to the inverse of the trade elasticity multiplied by the share of foreign expenditure on foreign goods, as established by Gros (1987) in the context of the Krugman (1980) model. Since the United States is small compared to the rest of the world, this is roughly 1/θ 20%, both in the exercises with and without trade costs. In contrast, Figure 4 shows that the optimal export tax is around 60% and slowly decreasing in absolute value with Foreign's relative unit labor requirements. As shown in Table 2, these differences in design are associated with significant welfare effects, at least within the scope of this simple calibrated example.
Intuitively, the equivalence emphasized by Arkolakis et al. (2012) builds on the observation that at the aggregate level, standard gravity models are equivalent to endowment models in which countries exchange labor and relative labor demand curves are iso-elastic. Hence, conditional on the shape of these demand curves, the aggregate implications of uniform changes in trade costs, i.e. exogenous demand shifters, must be the same in all gravity models. For those particular changes, the micro-level assumptions through which iso-elastic demand curves come about-either CES utility functions in the Armington model or an extreme value distribution in the Eaton and Kortum (2002) model-are irrelevant. Trade taxes, however, are imposed on goods, not labor. When het-erogeneous across goods, such taxes no longer act as simple labor demand shifters and the equivalence in Arkolakis et al. (2012) breaks down. This is precisely what happens when trade taxes are chosen optimally.

Concluding Remarks
Comparative advantage is at the core of neoclassical trade theory. In this paper we have taken a first stab at exploring how comparative advantage across nations affects the design of optimal trade policy. In the context of a canonical Ricardian model of international trade we have shown that optimal trade taxes should be uniform across imported goods and weakly monotone with respect to comparative advantage across exported goods. Specifically, export goods featuring weaker comparative advantage should be taxed less (or subsidized more) relative to those featuring stronger comparative advantage, reflecting the fact that countries have more room to manipulate world prices in their comparative-advantage sectors.
Though the focus of our paper is primarily normative, the previous results also have positive implications. Like perfectly competitive models providing a benchmark to identify market failures, we view our model with a welfare-maximizing government as a useful benchmark to assess the importance of political-economy considerations in practice. Previous empirical work by Broda et al. (2008) and Bagwell and Staiger (2011) suggests that terms-of-trade considerations do affect observed trade policies across countries and industries. In future work it would be interesting to explore empirically the extent to which comparative advantage shapes trade taxes across import-oriented and exportoriented sectors. The extent to which it does may provide a new window on the preferences and constraints faced by policymakers, including in agriculture where protectionism remains a salient global policy issue.
At a technical level, characterizing optimal trade taxes in a Ricardian model is nontrivial. As mentioned in the Introduction, the maximization problem of the country manipulating its terms-of-trade is infinite-dimensional, non-concave, and non-smooth. A second contribution of our paper is to show how to use Lagrange multiplier methods to solve such problems. Our basic strategy can be sketched as follows: (i) use the primal approach to go from taxes to quantities; (ii) identify concave subproblems for which general Lagrangian necessity and sufficiency theorems apply; and (iii) use the additive separability of preferences to break the Lagrangian into multiple low-dimensional maximization problems that can be solved by simple calculus. Although we have focused on optimal trade taxes in a Ricardian model, our approach is well suited to other additively separable problems. For instance, one could use these tools to compute fully optimal policy in the Melitz (2003) model, extending the results of Demidova and Rodríguez-Clare (2009) and Felbermayr et al. (2011).
Finally, we have studied the quantitative implications of our theoretical results for the design of unilaterally optimal trade taxes in agricultural and manufacturing sectors. In our applications, we have found that trade taxes that vary with comparative advantage across goods lead to substantially larger welfare gains than optimal uniform trade taxes. In spite of the similarities between welfare gains from trade across models featuring different margins of adjustment-see e.g. Atkeson and Burstein (2010) and Arkolakis et al. (2012)-this result illustrates that the design of and the gains associated with optimal trade policy may crucially depend on the extent of heterogeneity at the micro level.

A.2 Lemma 2
Proof of Lemma 2. (⇒) Suppose that w 0 * , p 0 , c 0 , c 0 * , q 0 , q 0 * solves Home's planning problem. By Definition 3, w 0 * , p 0 , c 0 , c 0 * , q 0 , q 0 * solves max w * ≥0,p≥0,c≥0,c * ,q≥0,q * ´u i (c i ) di subject to (5)-(9). By definition of m ≡ c − q, we know that c i = m i + q i for all i. By Lemma 1, we also know that (w * , p, c, c * , q, q * ) satisfies conditions (5)-(8) if and only if equations (10)-(14) hold. The two previous observations imply that w 0 * , m 0 = c 0 − q 0 , q 0 solves max w * ≥,m,q≥0´i The rest of the argument proceeds by contradiction. Suppose that w 0 * , m 0 , q 0 solves (P ), but does not solve (P). Then there must exist a solution w 1 * , m 1 , q 1 of (P) such that at least one of the two constraints (16) and (17) is slack. There are three possible cases. First, constraints (16) and (17) may be simultaneously slack. In this case, starting from m 1 , one could strictly increase imports for a positive measure of goods by a small amount, while still satisfying (15)-(17). This would strictly increase utility and contradict the fact that w 1 * , m 1 , q 1 solves (P). Second, constraint (16) may be slack, whereas constraint (17) is binding. In this case, starting from w * 1 and m 1 , one could strictly increase imports for a positive measure of goods and decrease the foreign wage by a small amount such that (17) still binds. Since (15) is independent of w * and m and (16) is slack to start with, (15)-(17) would still be satisfied. Since domestic utility is independent of w * , this would again increase utility and contradict the fact that w 1 * , m 1 , q 1 solves (P). Third, constraint (17) may be slack, whereas constraint (16) is binding. In this case, starting from w * 1 and m 1 , one could strictly increase imports for a positive measure of goods and increase the foreign wage by a small amount such that (16) still binds. For the exact same reasons as in the previous case, this would again contradict the fact that w 1 * , m 1 , q 1 solves (P).