Firm Theory

with Simplified Cobb-Douglas Production Function

We begin by telling Mathematica what the parameters (or constants) of the model are. Everything else will be treated as a variable.

SetAttributes[b, Constant]
SetAttributes[T, Constant]

The Clear command tells Mathematica to wipe out any previous values associated with the parameters and variables of the problem.  Notice that the semi-colons at the end of input lines suppress the display of output.

Clear[b, T, x1, L, pi, p1, w, tempp1, tempw, eqx1, eqL, plotx1, plotL];

We then state the firm's problem by defining a one-input production function
x1 = T L^b
and the profit function as
pi = p1 x1 + w L
Substituting the production function into the profit function we obtain

pi = p1*T*L^b - w*L;

Then we compute the first order condition as

Solve[D[pi, L] == 0, L]

Then we create the new variable tempL which will contain the solution found above for L.

tempL = L /. %[[1]]

Substituting the solution found for L into the produccion function we obtain the supply function for x1 which we assign to the temporary variable tempx1

tempx1 = T*tempL^b

We want to plot the good supply function and the labor demand function with price and wage in the vertical axis respectively. Begin with the good supply function.  In the next two sentences we create an equation equalizing x1 to its expression contained in the temporary variable tempx1, then assign to the variable plotx1 the result of solving the equation for p1.

eqx1 = x1 == tempx1; 
plotx1 = Solve[eqx1, p1]

Then we assign the corresponding results into the variable tempp1 and plot it

tempp1 = p1 /. plotx1[[1]]; 
Plot[tempp1 /. {b -> 0.4, T -> 1, w -> 100}, {x1, 0.01, 0.1}, 
  AxesLabel -> {"x1", "p1"}, PlotLabel -> "Supply Curve for x1"]

eqL = L == tempL; 
plotL = Solve[eqL, w]; 
tempw = w /. plotL[[1]]
Plot[tempw /. {b -> 0.4, T -> 1, p1 -> 1}, {L, 0.01, 0.1}, 
  AxesLabel -> {"L", "w"}, PlotLabel -> "Labor Demand Curve"]