Profit Maximization

Maximizing profit

Let's find the profit-maximizing choice for the production function x^(1/2).
We start by defining the production function

f[x_] := x^(1/2)

Profits as a function of x are

Profit[x_,p_,w_] := p f[x] - w x

Let's plot this for p=w=1:

Plot[Profit[x,1,1],{x,.001,1}]

In  order to find the profit-maximizing level of input, we solve for that x that makes the derivative of profit equal to zero for arbitrary values of p and w:

Solve[D[Profit[x,p,w],x]==0,x]

Solve[D[Profit[x,1,1],x]==0,x]

Profit[x, p, w] /. %

ProfitWithFixed[x_, p_, w_, k_] := p f[x] - w x - k

Solve[D[ProfitWithFixed[x, p, w, 0], x] == 0, x]

Solve[D[ProfitWithFixed[x, p, w, 100], x] == 0, x]

The Cobb-Douglas profit function

f[x1_,x2_] := x1^(1/4) x2^(1/4)

The profit function is

Profit[x1_,x2_,p_,w1_,w2_] := p f[x1,x2] - w1 x1 - w2 x2

ContourPlot[Profit[x1,x2,20,2,1],{x1,0.01,80},{x2,0.01,80}
]

Let's solve for the optimal value of the two factor inputs.  Just as before, we take the derivatives with respect to each input, set them
equal to zero, and then solve the resulting system of equations.  This time we'll
give the solution a name so we can use it later

solution = Solve[{D[Profit[x1,x2,p,w1,w2],x1]==0, 
D[Profit[x1,x2,p,w1,w2],x2]==0},
{x1,x2}]

solution /. {p -> 20, w1 -> 2, w2 -> 1}

Only the second solution is economically relevant, since the first solution involves negative quantities of the factors of production.

realsol = solution[[2]]

f[x1, x2] /. realsol

Profit[x1, x2, p, w1, w2] /. {p -> 20, w1 -> 2, w2 -> 1}

% /. realsol

N[%]

solution=Solve[{D[Profit[x1,x2,20,2,1],x1]==0,
D[Profit[x1,x2,20,2,1],x2]==0},{x1,x2}]

N[%]

Profit[x1, x2, 20, 2, 1] /. %

N[%]