Varian 6.7

Firm 1 production of guns from oil

g[x_] := 2  x

Firm 2 production of butter from oil

b[x_] := 3  x

Utility of consumer 1 (owner of firm 1)

u1[g_, b_] := (g^0.4) (b^0.6)

Utility of consumer 2 (owner of firm 2)

u2[g_, b_] := 10 + 0.5 Log[g] + 0.5 Log[b]

Marginal revenue - marginal cost of firm 1, given p(oil) = 1

m1 = pg D[g[x]] - x

Marginal revenue - marginal cost of firm 2, given p(oil)=1

m2 = pb D[b[x]] - x

Zero profit condition on both firms

zp = Solve[{m1 == 0, m2 == 0}, {pg, pb}]

How much g will be produced in terms of b, given the entire economy's wealth constraint

Solve[pg g + pb b == 20, g] /. zp

Consumer 1 demand for butter

W = 10
d1b = (0.6  W)/pb /. zp[[1]]

consumer 2 demand for butter

d2b = (0.5 W)/pb /. zp[[1]]

Total demand for butter

totdb = d1b + d2b

Oil used to produce butter

oilbutter = Solve[totdb == b[x], x]

Oil used to produce guns

oilguns = 20 - x /. oilbutter

Consumer 1 demand for guns

d1g = (0.4  W)/pg /. zp[[1]]

Consumer 2 demand for guns

d2g = (0.5 W)/pg /. zp[[1]]

Total demand for guns

totdg = d1g + d2g

Utility levels of consumers 1 and 2

u1[d1g, d1b]

u2[d2g, d2b]

Altered production function for butter

b[x_] := 5  x
m2 = pb D[b[x]] - x

zp = Solve[{m1 == 0, m2 == 0}, {pg, pb}]

W = 10
d1b = (0.6  W)/pb /. zp[[1]]

d2b = (0.5 W)/pb /. zp[[1]]

totdb = d1b + d2b

oilbutter = Solve[totdb == b[x], x]

u1[d1g, d1b]

u2[d2g, d2b]