Econ 407: answers to some of pre-test questions. Please redo and see if our calculations are correct.
>
Qs:=2*p^2-p+4;
>
dQs:=diff(Qs,p);
>
eval(Qs,p=5);
>
E:=(4*5-1)*(5.0/49);
Demand is elastic.
Maximize the following utility function subject to the constraint that you have $100 and you buy 2 commodities. Commodity 1, x, costs $2 a piece while commodity 2, y, costs $1 a piece. First, write the budget constraint, then, maximize the utility function using the Lagrangian method. Interpret your results, including the meaning of the Lagrangian.
>
const:=100-2*x-y;
>
u:=2*x+y+2*x*y;
Form the Lagrangian function as follows:
>
L:=u+lambda*(100-2*x-y);
Take the first derivative of the Lagrangian function with respect to x, y, and lambda. Then set equal to zero, and solve for the three unknowns.
>
Lx:=diff(L,x);
>
Ly:=diff(L,y);
>
Llambda:=diff(L,lambda);
>
solve({Lx,Ly,Llambda},{x,y,lambda});
You can now find the value of utility for x=25 and y=50.
>
eval(u,{x=25,y=50});
Now let us increase the value of the constraint by 51, which is the value of Lambda, and see what happens to total utility.
>
L:=u+lambda*(151.0-2*x-y);
>
Lx:=diff(L,x);
>
Ly:=diff(L,y);
>
Llambda:=diff(L,lambda);
>
solve({Lx,Ly,Llambda},{x,y,lambda});
>
eval(u,{x=37,y=75});
>
deltau:=5699-2600;
>
plot3d(u,x=0..50,y=0..100);
To check the second order conditions, you need to take the second derivatives and cross derivatives.
>