-----maxima-bounces at math.utexas.edu wrote: -----
>Are?there?any?tricks?to?solve?the?following?system?of?equations:
>
>kill(all)$
>assume(X1>0,?X2>0,w1>0,w2>0,Y>0,lambda>0)$
>L:(w1*X1+w2*X2)+lambda*(Y?-(X1^a)*(X2^b));
>eq1:diff(L,X1,1)=0;
>eq2:diff(L,X2,1)=0;
>eq3:diff(L,lambda,1)=0;
>solve([eq1,eq2,eq3],[X1,X2,lambda]);
I have no tricks to offer--only a do it by hand solution. It's unfortunate that
solve and to_poly_solve are unable to do this automatically.
(%i1) radexpand : all$
(%i2) (L:(w1*X1+w2*X2)+lambda*(Y -(X1^a)*(X2^b)),
eq1:diff(L,X1,1),
eq2:diff(L,X2,1),
eq3:diff(L,lambda,1));
(%o2) Y-X1^a*X2^b
(%i3) eqs : [eq1,eq2,eq3];
(%o3) [w1-a*X1^(a-1)*X2^b*lambda,w2-b*X1^a*X2^(b-1)*lambda,Y-X1^a*X2^b]
(%i4) s1 : solve(part(eqs,3),X1);
"Is "a" an "integer"?"no;
"Is "X2*Y" positive, negative, or zero?"pos;
(%o4) [X1=Y^(1/a)/X2^(b/a)]
(%i5) eqs : subst(s1,eqs);
(%o5) [w1-a*X2^(b-((a-1)*b)/a)*Y^((a-1)/a)*lambda,w2-(b*Y*lambda)/X2,0]
(%i6) s2 : solve(part(eqs,2),lambda);
(%o6) [lambda=(w2*X2)/(b*Y)]
(%i7) eqs : subst(%,eqs);
(%o7) [w1-(a*w2*X2^(-((a-1)*b)/a+b+1)*Y^((a-1)/a-1))/b,0,0]
(%i8) s3 : solve(part(eqs,1),X2);
"Is "(b+a)/a" an "integer"?"no;
"Is "a*b*w1*w2*Y" positive, negative, or zero?"pos;
(%o8) [X2=(b^(a/(b+a))*w1^(a/(b+a))*Y^(1/(b+a)))/(a^(a/(b+a))*w2^(a/(b+a)))]
(%i9) s2 : subst(s3,s2);
(%o9) [lambda=(b^(a/(b+a)-1)*w1^(a/(b+a))*w2^(1-a/(b+a))*Y^(1/(b+a)-1))/a^(a/(b+a))]
(%i10) s1 : subst(s3, subst(s2,s1));
(%o10) [X1=(a^(b/(b+a))*w2^(b/(b+a))*Y^(1/a-b/(a*(b+a))))/(b^(b/(b+a))*w1^(b/(b+a)))]
It's terrific that you are planing a computational microeconomics course that uses Maxima. Let
us know how that works.
--Barton