restart:The standard Cournot modelP:=Q->(Gamma-Q);u1:=(q1,q2)->q1*P(q1+q2)-c1*q1;u2:=(q1,q2)->q2*P(q1+q2)-c2*q2;eq1:=diff(u1(q1,q2),q1)=0;eq2:=diff(u2(q1,q2),q2)=0;solve({eq1,eq2},[q1,q2]);assign([q1,q2],%);factor(u1(q1,q2));factor(u2(q1,q2));P(q1+q2);restart:The Cournot model with uncertain costs.P:=Q->(Gamma-Q);u1:=(q1,q2)->q1*P(q1+q2)-c1*q1;u2:=(q1,q2,c2)->q2*P(q1+q2)-c2*q2;expected1:=(q1,q2d,q2u,p)->u1(q1,q2d)*(1-p)+u1(q1,q2u)*p;q2plus:=solve(diff(u2(q1,q2,cplus),q2)=0,q2);q2minus:=solve(diff(u2(q1,q2,cminus),q2)=0,q2);q1star:=solve(diff(expected1(q1,q2d,q2u,p),q1)=0,q1);solve({q2plus=q2u,q2minus=q2d,q1star=q1},[q1,q2d,q2u]);assign([q1,q2d,q2u],%);q1;q2d;q2u;expected1(q1,q2d,q2u,p);factor(%);restart:StackelbergP:=Q->Gamma-Q;u1:=(q1,q2)->q1*P(q1+q2)-c1*q1;u2:=(q1,q2)->q2*P(q1+q2)-c2*q2;q2br:=q1->solve(diff(u2(q1,q2),q2)=0,q2);q2br(q1);u1(q1,q2br(q1));q1star:=solve(diff(u1(q1,q2br(q1)),q1)=0,q1);q2star:=q2br(q1star);factor(u1(q1star,q2star));factor(u2(q1star,q2star));Entry Deterrencerestart:P:=Q->Gamma-Q;u1:=(q1,q2)->q2*P(q1+q2)-(a*q2+b);q2m:=q1->solve(diff(u1(q1,q2),q2)=0,q2);q2m(q1);f:=q1->u1(q1,q2m(q1));factor(f(q1));solve(f(q1)=0,q1);assign(q1,%[2]);q1;This value of q1 is the smallest firm 1 production quantity which makes firm 2's profit =0. The lowest quantity gives firm 1 the highest profit.P(q1)*q1-(a*q1+b);simplify(%);restart:De:=q->piecewise(q<10,100-q^2,q>=10,0);C:=q->50+q^2;plot({De(q),C(q)},q=0..15,color=[red,green]);diff(De(q),q);a:=eval( %, [q = 2*q]);qstar:=fsolve(De(2*q)+q*a-diff(C(q),q)=0,q);plot(De(2*q)+q*a-diff(C(q),q),q=0..5);De(qstar);qstar*De(2*qstar)-C(qstar);restart:with(plots):p1:=x->x^3;p2:=x->x^2;v1:=(x,y)->piecewise(x<y,2*p1(x)-1,x=y,p1(x)-p2(x),x>y,1-2*p2(x));plot3d(v1(x,y),x=0..1,y=0..1,axes=boxed);xstar:=fsolve(p1(x)+p2(x)-1=0,x);v1(xstar,xstar);restart: f:=x->6*x*(1-x);F:=x->int(f(y),y=0..x);fsolve(1-F(x)-x*f(x)=0,x);restart:ode:=a*(y(x)-x)*diff(y(x),x)=y(x);dsolve(ode,y(x));