Below is a program that will give you access to a nearly limitless number of practice problems for the Cournot, Quantity Leadership, and Price Leadership models. To start, click the new problem button below and it will provide you with a market demand function and cost functions for two firms. From there you can go onto solve the Cournot model, the Quantity Leadership model (firm 1 leader), and price leadership model (firm 1 leader). To help guide you in solving this models. Below is an example.

Cournot and Quantity Leadership (Stackelberg)

Inverse Market Demand: P=105-4×Q
Firm 1 Cost Function: (Subscript[C, 1])((Subscript[q, 1]))=5(Subscript[q, 1]^2)
Firm 2 Cost Function: (Subscript[C, 2])((Subscript[q, 2]))=4(Subscript[q, 2]^2)

Example

Cournot

Since we know that the firm’s goal is to maximize profits in every situation, we will start by finding their marginal revenue and marginal cost functions (because we know that profit maximization occurs when MR=MC). To find the marginal revenue function, we first need to find the total revenue function, because marginal revenue is the derivative of total revenue. The total revenue function of each firm is simply the quantity it produces multiplied by the price it receives for each good, therefore, for each firm:

(Subscript[TR, 1])=P×(Subscript[q, 1])=(105-4×Q)(Subscript[q, 1])=(105-4×((Subscript[q, 1])+(Subscript[q, 2])))(Subscript[q, 1])=105(Subscript[q, 1])-4(Subscript[q, 1]^2)-4(Subscript[q, 1])(Subscript[q, 2])

(Subscript[TR, 2])=P×(Subscript[q, 2])=(105-4×Q)(Subscript[q, 2])=(105-4×((Subscript[q, 1])+(Subscript[q, 2])))(Subscript[q, 2])=105(Subscript[q, 1])-4(Subscript[q, 1])(Subscript[q, 2])-4(Subscript[q, 2]^2)

Note that for the price we substituted in the inverse market demand function. From here we can find the marginal revenue functions by taking the derivative of each total revenue function.

(Subscript[MR, 1])=((∂(Subscript[TR, 1]))/(∂(Subscript[q, 1])))=105-8(Subscript[q, 1])-4(Subscript[q, 2])

(Subscript[MR, 2])=((∂(Subscript[TR, 2]))/(∂(Subscript[q, 2])))=105-4(Subscript[q, 1])-8(Subscript[q, 2])

As we are attempting to find the profit maximizing amount of output for each firm, we need to find the marginal cost curves as well. The marginal cost curve is the derivative of the total cost curves (given above).

(Subscript[MC, 1])=((∂(Subscript[C, 1])((Subscript[q, 1])))/(∂(Subscript[q, 1])))=10(Subscript[q, 1])

(Subscript[MC, 2])=((∂(Subscript[C, 2])((Subscript[q, 2])))/(∂(Subscript[q, 2])))=8(Subscript[q, 2])

As we know that the profit maximizing condition for a firm is when MR=MC. Setting our equations equal to each other for each firm yields:

(Subscript[MR, 1])=(Subscript[MC, 1])→105-8(Subscript[q, 1])-4(Subscript[q, 2])=10(Subscript[q, 1])→105-4(Subscript[q, 2])=18(Subscript[q, 1])→(Subscript[q, 1])=5.833-0.222(Subscript[q, 2])

(Subscript[MR, 2])=(Subscript[MC, 2])→105-4(Subscript[q, 1])-8(Subscript[q, 2])=8(Subscript[q, 2])→105-4(Subscript[q, 1])=16(Subscript[q, 2])→(Subscript[q, 2])=6.5625-0.25(Subscript[q, 1])

We should note that we have not solved for numbers, but rather equations for our profit maximizing conditions. Why is this? Since we are in a duopoly, the profits of one firm depend on the actions of the other firm. Therefore for firm 1 for instance, if firm 2 increases its quantity by 1 unit, the optimal thing for firm 1 to do is to reduce it’s production by 0.222 units. Since these equations tell us the best thing that one firm can do in response to the other firm, we call these best response functions. How much output is actually produced by both firms? In equilibrium, we would expect that each firm will do the best they possibly can given what the other firm is doing. This means that for firm 1’s best response function ((Subscript[q, 1])=5.833-0.222(Subscript[q, 2])), the (Subscript[q, 2]) in that equation is being determined by firm 2’s best response function. This means that firm 1 will know how much firm 2 will produce in response to its own choice of (Subscript[q, 2]). Therefore we can find firm 1’s optimal quantity:

({{({{(Subscript[q, 1])=5.833-0.222(Subscript[q, 2])
(Subscript[q, 1])=5.833-0.222(6.5625-0.25(Subscript[q, 1]))}})
(Subscript[q, 1])=5.833-1.457+0.0556(Subscript[q, 1])
0.9444(Subscript[q, 1])=4.376`
(Subscript[q, 1])=4.634}})

We can then plug this value back into the best response function for firm 2 to find their optimal quantity:

({{({{(Subscript[q, 2])=6.5625-0.25(Subscript[q, 1])
(Subscript[q, 2])=6.5625-0.25×4.634
(Subscript[q, 2])=5.404}})}})

Now that we know what each firm is going to produce (and therefore know the total market quantity), we can find the market price using the inverse market demand curve.

({{({{P=105-4×Q
P=105-4×((Subscript[q, 1])+(Subscript[q, 2]))
P=105-4×(4.634+5.404)
P=64.848}})}})

Finally, we can determine each of the firms’ profits (Π=TR-TC):

({{({{(Subscript[Π, 1])=TR-TC
(Subscript[Π, 1])=P×(Subscript[q, 1])-(Subscript[C, 1])((Subscript[q, 1]))
(Subscript[Π, 1])=64.848×4.634-5×(4.634^2)=193.136

(Subscript[Π, 2])=P×(Subscript[q, 2])-(Subscript[C, 2])((Subscript[q, 2]))
(Subscript[Π, 2])=64.848×5.404-4×(5.404^2)=233.62572799999998`}})}})

Quantity Leadership

Quantity leadership has many similarities with the Cournot model. In fact, we are going to use the same best response functions that were derived in the Cournot model to solve the quantity leadership model. The most significant difference between these two models is that in the quantity leadership model, one firm gets to pick its quantity first and then the other firm has to respond to that choice (in the Cournot model, both firms chooses their quantity simultaneously). You can imagine, that this yields quite the advantage to the leading firm. We know based upon their best response functions, that increasing your quantity results in the other firm reducing their quantity. This means that in the quantity leadership model, the leading firm (in this example firm 1), might be able to take some sales away from the other firm by choosing a higher quantity than they would in the Cournot model.

How do firms choose their quantity in the quantity leadership model? The leading firm (firm 1) gets to choose their quantity and then the following firm, chooses their optimal quantity in response. Now the leading firm cannot just choose any quantity it wants, because it knows that the following firm will respond with its own output. Therefore, in making its decision, firm 1 will take into account how its choice of quantity will effect firm 2’s choice. It does that by incorporating firm 2’s best response function into its decision problem. 

From the Cournot model, we know that firm 2’s best response function is (Subscript[q, 2])=6.5625-0.25(Subscript[q, 1]). This means that the demand facing firm 1 is:

({{({{P=105-4×Q=105-4((Subscript[q, 1])+(Subscript[q, 2]))
P=105-4((Subscript[q, 1])+6.5625-0.25(Subscript[q, 1]))
P=105-4(Subscript[q, 1])-26.25`+(Subscript[q, 1])
P=78.75-3(Subscript[q, 1])}})}})

where the second line substitutes in firm 2’s best response function. Notice that the final line is the demand available to firm 1, once we have taken into account firm 2’s output. From here we can find firm 1 marginal revenue function:

({{({{(Subscript[TR, 1])=P×(Subscript[q, 1])=(78.75-3(Subscript[q, 1]))(Subscript[q, 1])=78.75(Subscript[q, 1])-3(Subscript[q, 1]^2)
(Subscript[MR, 1])=((∂(Subscript[TR, 1]))/(∂(Subscript[q, 1])))=78.75-6(Subscript[q, 1])}})}})

Firm 1’s goal is still to maximize profits, which occurs when MR=MC. Therefore the optimal quantity of firm 1 is:

({{({{MR=MC
78.75-6(Subscript[q, 1])=10(Subscript[q, 1])
78.75=16(Subscript[q, 1])
(Subscript[q, 1])=4.922}})}})

Plugging this value into the best response function for firm 2, yields

({{({{(Subscript[q, 2])=6.5625-0.25(Subscript[q, 1])
(Subscript[q, 2])=6.5625-0.25×4.922
(Subscript[q, 2])=5.332}})}})

Now we can find the market price, using the inverse market demand function and firm quantities:

({{({{P=105-4×Q=105-4×((Subscript[q, 1])+(Subscript[q, 2]))
P=105-4×(4.922+5.332)=63.984`}})}})

Profits can be calculated in the usual way:

({{({{(Subscript[Π, 1])=P×(Subscript[q, 1])-(Subscript[C, 1])((Subscript[q, 1]))=63.984×4.922-5×(4.922^2)}})=193.798828`
(Subscript[Π, 2])=P×(Subscript[q, 2])-(Subscript[C, 2])((Subscript[q, 2]))=63.984×5.332-4×(5.332^2)=227.44179200000002`}})

It should be noted that as a result of gaining the first mover advantage, firm 1 is able to increase their profits at the expense of firm 2.

Interactive Learning Module

Manipulate[Module[{q1BRC,q1BRP,q2BRC,q2BRP,CQ1S,CQ2S,CMPS,CΠ1,CΠ2,QLF1RDC,QLF1RDP,QLQ1S,QLQ2S,QLMPS,QLΠ1,QLΠ2,PLMR1,PLQ2S,PLΠ1,PLΠ2,PLMPS,AK,LTC1,LTC2,MC1,MC2,TR1,TR2,MR1,MR2,BR1,BR2,QS1,QS2,PS,Π1,Π2,RD1,TR1QL,MR1QL,QS1QL,QS2QL,PSQL,Π1QL,Π2QL},
LTC1=Boole[COSTIND==1](c10+c11 q1)+Boole[COSTIND==2](c10+c11 q1+c12 (q1^2));
LTC2=Boole[COSTIND==1](c20+c21 q2)+Boole[COSTIND==2](c20+c21 q2+c22 (q2^2));
MC1=D[LTC1,q1];
MC2=D[LTC2,q2];
TR1=(A-b(q1+q2))q1;
TR2=(A-b(q1+q2))q2;
MR1=D[TR1,q1];
MR2=D[TR2,q2];
BR1=q1/.Last@Solve[MC1==MR1,q1];
BR2=q2/.Last@Solve[MC2==MR2,q2];
QS1=N[q1/.Last@Solve[(BR1/.q2->BR2)==q1,q1]];
QS2=BR2/.q1->QS1;
PS=A-b(QS1+QS2);
Π1=PS*QS1-(LTC1/.q1->QS1);
Π2=PS*QS2-(LTC2/.q2->QS2);
RD1=FullSimplify[A-b(q1+BR2)];
TR1QL=RD1*q1;
MR1QL=D[TR1QL,q1];
QS1QL=q1/.Last@Solve[MR1QL==MC1,q1];
QS2QL=BR2/.q1->QS1QL;
PSQL=A-b(QS1QL+QS2QL);
Π1QL=PSQL*QS1QL-(LTC1/.q1->QS1QL);
Π2QL=PSQL*QS2QL-(LTC2/.q2->QS2QL);
QLF1RDC=N[(((b+2 c2)A)/(2 (b+c2)))];
QLF1RDP=N[(((b+2 c2)b)/(2 (b+c2)))];
QLQ1S=q1/.Last@Solve[QLF1RDC-2QLF1RDP*q1==2c1 q1,q1];
QLQ2S=q2BRC-q2BRP*QLQ1S;
QLMPS=A-b(QLQ1S+QLQ2S);
QLΠ1=QLMPS*QLQ1S-c1 (QLQ1S^2);
QLΠ2=QLMPS*QLQ2S-c2 (QLQ2S^2);
AK[IND_,STEP_,HINT_,FORMULA_,ANSWER_]:=If[IND==0,{StringJoin["Step ",ToString[STEP],":"],"",""},If[IND==1,{StringJoin["Step ",ToString[STEP],":",HINT],"",""},If[IND==2,{StringJoin["Step ",ToString[STEP],":",HINT],FORMULA,""},{StringJoin["Step ",ToString[STEP],":",HINT],FORMULA,ANSWER}]]];
Grid[{{Style["Problem",Bold],SpanFromLeft},{"Market Demand:",StringJoin["P=",ToString[A],"-",ToString[b],"×Q"]},{"Firm 1 Cost Function:",StringJoin["(Subscript[LTC, 1])=",ToString[LTC1,StandardForm]]},{"Firm 2 Cost Function:",StringJoin["(Subscript[LTC, 2])=",ToString[LTC2,StandardForm]]},{},{Style["Answers",Bold],SpanFromLeft},{"Instruction","Formula","Answer"},{Style["Cournot Model:",Bold],""},AK[STEP1,1,"Find the total revenue for each firm\n","TR=P[(Subscript[q, 1])+(Subscript[q, 2])]*(Subscript[q, i])",StringJoin["(Subscript[TR, 1])=",ToString[Expand[TR1],StandardForm],"\n","(Subscript[TR, 2])=",ToString[Expand[TR2],StandardForm]]],AK[STEP2,2,"Find the marginal revenue for each firm\n","(Subscript[MR, i])=((∂(Subscript[TR, i]))/(∂(Subscript[q, i])))",StringJoin["(Subscript[MR, 1])=",ToString[Expand[MR1],StandardForm],"\n","(Subscript[MR, 2])=",ToString[Expand[MR2],StandardForm]]],AK[STEP3,3,"Find the marginal cost for each firm\n","(Subscript[MC, i])=((∂(Subscript[LTC, i]))/(∂(Subscript[q, i])))",StringJoin["(Subscript[MC, 1])=",ToString[Expand[MC1],StandardForm],"\n","(Subscript[MC, 2])=",ToString[Expand[MC2],StandardForm]]],AK[STEP4,4,"Find the best response function for each firm\n","(Subscript[MC, i])=(Subscript[MR, i])",StringJoin["(Subscript[q, 1])=",ToString[Expand[BR1],StandardForm],"\n","(Subscript[q, 2])=",ToString[Expand[BR2],StandardForm]]],AK[STEP5,5,"Find the optimal quantity to produce for firm 1\n","Plug (Subscript[BR, 2]) into (Subscript[BR, 1])",StringJoin["(Subscript[q, 1]^( * ))=",ToString[Expand[Round[QS1,0.001]],StandardForm]]],AK[STEP6,6,"Find the optimal quantity to produce for firm 2\n","Plug (Subscript[q, 1]^( * )) into (Subscript[BR, 2])",StringJoin["(Subscript[q, 2]^( * ))=",ToString[Expand[Round[QS2,0.001]],StandardForm]]],AK[STEP7,7,"Find the market price\n","Plug (Subscript[q, 1]^( * ))+(Subscript[q, 2]^( * )) into the inverse demand curve",StringJoin["(SuperStar[P])=",ToString[Expand[Round[A-b(QS1+QS2),0.001]],StandardForm]]],AK[STEP8,8,"Find the profit of each firm\n","(Subscript[Π, i])=(Subscript[TR, i])-(Subscript[TC, i])",StringJoin["(Subscript[Π, 1])=",ToString[Expand[Round[Π1,0.001]],StandardForm],"\n","(Subscript[Π, 2])=",ToString[Expand[Round[Π2,0.001]],StandardForm]]],{},{Style["Quantity Leadership (Firm 1 Leader):",Bold,Medium]},{Style["The problem is the same as with the cournot model above, so we already know the best response function of firm 2",Italic,Medium],SpanFromLeft},AK[STEP9,1,"Find firm 1's residual demand using firm 2's best response function\n","(Subscript[P, 1])=A-b((Subscript[q, 1])+(Subscript[BR, 2]))",StringJoin["(Subscript[P, 1])=",ToString[Expand[RD1],StandardForm]]],AK[STEP10,2,"Find firm 1's TR using it's residual demand curve\n","(Subscript[TR, 1])=(Subscript[P, 1])(Subscript[q, 1])",StringJoin["(Subscript[TR, 1])=",ToString[Expand[TR1QL],StandardForm]]],AK[STEP11,3,"Find firm 1's MR\n","(Subscript[MR, 1])=((∂(Subscript[TR, 1]))/(∂(Subscript[q, 1])))",StringJoin["(Subscript[MR, 1])=",ToString[Expand[MR1QL],StandardForm]]],AK[STEP12,4,"Find firm 1's optimal quantity\n","(Subscript[MR, 1])=(Subscript[MC, 1])",StringJoin["(Subscript[q, 1]^( * ))=",ToString[Expand[Round[QS1QL,0.001]],StandardForm]]],AK[STEP13,5,"Find firm 2's optimal quantity\n","Plug (Subscript[q, 1]^( * )) into (Subscript[BR, 2])",StringJoin["(Subscript[q, 2]^( * ))=",ToString[Expand[Round[QS2QL,0.001]],StandardForm]]],AK[STEP14,6,"Find the market price\n","Plug (Subscript[q, 1]^( * ))+(Subscript[q, 2]^( * )) into the inverse demand function",StringJoin["(SuperStar[P])=",ToString[Expand[Round[PSQL,0.001]],StandardForm]]],AK[STEP15,7,"Find the profit of each firm\n","(Subscript[Π, i])=(Subscript[TR, i])-(Subscript[TC, i])",StringJoin["(Subscript[Π, 1])=",ToString[Expand[Round[Π1QL,0.001]],StandardForm],"\n","(Subscript[Π, 2])=",ToString[Expand[Round[Π2QL,0.001]],StandardForm]]]},Alignment->Left]
],
Button["New Problem",{c10=RandomInteger[{1,5}],c11=RandomInteger[{1,5}],c12=RandomInteger[{1,5}],c20=RandomInteger[{1,5}],c21=RandomInteger[{1,5}],c22=RandomInteger[{1,5}],A=RandomInteger[{20,200}],b=RandomInteger[{1,5}],c1=RandomInteger[{1,5}],c2=RandomInteger[{1,5}],COSTIND=RandomInteger[{1,2}]}],Delimiter,Style["Cournot",Bold],Delimiter,{{STEP1,1,"Step 1"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP2,1,"Step 2"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP3,1,"Step 3"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP4,1,"Step 4"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP5,1,"Step 5"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP6,1,"Step 6"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP7,1,"Step 7"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP8,1,"Step 8"},{1->"Instruction",2->"Formula",3->"Answer"}},Style["Quantity Leadership",Bold],Delimiter,{{STEP9,1,"Step 1"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP10,1,"Step 2"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP11,1,"Step 3"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP12,1,"Step 4"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP13,1,"Step 5"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP14,1,"Step 6"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP15,1,"Step 7"},{1->"Instruction",2->"Formula",3->"Answer"}}
]

,STEP1=1,STEP2=1,STEP3=1,STEP4=1,STEP5=1,STEP6=1,STEP7=1,STEP8=1,STEP9=1,STEP10=1,STEP11=1,STEP12=1,STEP13=1,STEP14=1,STEP15=1

Bertrand Competition with differentiated products

Example

Suppose that you have two firms: 1 and 2. Each firm produces a different version of a product and they compete on price. The firm’s demand curves are given by:

({{({{(Subscript[q, 1])=408-10(Subscript[p, 1])+4(Subscript[p, 2])
(Subscript[q, 2])=367+3(Subscript[p, 1])-7(Subscript[p, 2])}})}})

Additionally, assume each firm’s marginal cost is:

({{({{(Subscript[MC, 1])=30
(Subscript[MC, 2])=96}})}})

What will each firm charge for their version of the product in equilibrium?

Solution

Start by finding each firm’s total revenue equation

({{({{(Subscript[TR, 1])=(Subscript[p, 1])(Subscript[q, 1])=(Subscript[p, 1])(}})408-10(Subscript[p, 1])+4(Subscript[p, 2]))=408(Subscript[p, 1])-10(Subscript[p, 1]^2)+4(Subscript[p, 1])(Subscript[p, 2])
(Subscript[TR, 2])=(Subscript[p, 2])(Subscript[q, 2])=(Subscript[p, 2])(367+3(Subscript[p, 1])-7(Subscript[p, 2]))=367(Subscript[p, 2])+3(Subscript[p, 1])(Subscript[p, 2])-7(Subscript[p, 2]^2)}})

Next find the marginal revenue equation for each firm:

({{({{(Subscript[MR, 1])=((∂(Subscript[TR, 1]))/(∂(Subscript[p, 1])))=408-20(Subscript[p, 1])+4(Subscript[p, 2])
(Subscript[MR, 1])=((∂(Subscript[TR, 1]))/(∂(Subscript[p, 2])))=367+3(Subscript[p, 1])-14(Subscript[p, 2])}})}})

Since firms are profit maximizing, set marginal revenue equal to marginal cost in order to find the optimal price for a firm to charge as a function of the other firm’s price.

({{({{408-20(Subscript[p, 1])+4(Subscript[p, 2])=30}, {20(Subscript[p, 1])=378+4(Subscript[p, 2])
(Subscript[p, 1])=18.9+0.2(Subscript[p, 2])}, {□}, {367+3(Subscript[p, 1])-14(Subscript[p, 2])=96
14(Subscript[p, 2])=271+3(Subscript[p, 1])
(Subscript[p, 2])=19.35+0.214(Subscript[p, 1])}})}})

Now plug in the equation for (Subscript[p, 1]) into the equation for (Subscript[p, 2]) and solve for (Subscript[p, 1]).

({{({{(Subscript[p, 1])=18.9+0.2(Subscript[p, 2])
(Subscript[p, 1])=18.9+0.2(19.35+0.214(Subscript[p, 1]))
(Subscript[p, 1])=23.791}})}})

Plug in your answer into the equation for (Subscript[p, 2])

({{(Subscript[p, 2])=19.35+0.214(Subscript[p, 1])
(Subscript[p, 2])=19.35+0.214(23.791)
(Subscript[p, 2])=24.455}})

Interactive Learning Module

Manipulate[Module[{AK,QA,QB,TCA,TCB,TRA,TRB,MRA,MRB,PA,PB,pa,pb},
QA[pA_,pB_]:=AC-BA*pA+CA*pB;
QB[pA_,pB_]:=BC-BB*pB+CB*pA;
TRA=pA*QA[pA,pB];
TRB=pB*QB[pA,pB];
MRA=D[TRA,pA];
MRB=D[TRB,pB];
PA=pA/.Last@Solve[MRA==MCA,pA];
PB=pB/.Last@Solve[MRB==MCB,pB];
pa=pA/.Last@N@Solve[pA==PA/.pB->PB,pA];
pb=PB/.pA->pa;
AK[IND_,STEP_,HINT_,FORMULA_,ANSWER_]:=If[IND==0,{StringJoin["Step ",ToString[STEP],":"],"",""},If[IND==1,{StringJoin["Step ",ToString[STEP],":",HINT],"",""},If[IND==2,{StringJoin["Step ",ToString[STEP],":",HINT],FORMULA,""},{StringJoin["Step ",ToString[STEP],":",HINT],FORMULA,ANSWER}]]];
Grid[{{Style["Problem",Bold],SpanFromLeft},{"Firm 1 Demand Curve:",StringJoin["(Subscript[Q, 1])=",ToString[QA[(Subscript[p, 1]),(Subscript[p, 2])],StandardForm]]},{"Firm 2 Demand Curve:",StringJoin["(Subscript[Q, 2])=",ToString[QB[(Subscript[p, 1]),(Subscript[p, 2])],StandardForm]]},{"Firm 1 Marginal Cost:",StringJoin["(Subscript[MC, 1])=",ToString[MCA,StandardForm]]},{"Firm 2 Marginal Cost:",StringJoin["(Subscript[MC, 2])=",ToString[MCB,StandardForm]]},{},{Style["Answers",Bold],SpanFromLeft},{"Instruction","Formula","Answer"},AK[STEP1,1,"Find the total revenue for each firm\n","TR=p*Q",StringJoin["(Subscript[TR, 1])=",ToString[Expand[(Subscript[p, 1])*QA[(Subscript[p, 1]),(Subscript[p, 2])]],StandardForm],"\n","(Subscript[TR, 2])=",ToString[Expand[(Subscript[p, 2])*QA[(Subscript[p, 1]),(Subscript[p, 2])]],StandardForm]]],AK[STEP2,2,"Find the marginal revenue for each firm\n","MR=((∂TR)/(∂p))",StringJoin["(Subscript[MR, 1])=",ToString[Expand[MRA/.pA->(Subscript[p, 1])/.pB->(Subscript[p, 2])],StandardForm],"\n","(Subscript[MR, 2])=",ToString[Expand[MRB/.pA->(Subscript[p, 1])/.pB->(Subscript[p, 2])],StandardForm]]],AK[STEP3,3,"Find the price the firm charges\nas a function of the other firm's price\n","MR=MC",StringJoin["(Subscript[p, 1])=",ToString[Expand[PA]/.pB->(Subscript[p, 2]),StandardForm],"\n","(Subscript[p, 2])=",ToString[Expand[PB]/.pA->(Subscript[p, 1]),StandardForm]]],AK[STEP4,4,"Find the optimal price for firm 1 to charge\n","Plug the (Subscript[p, 2]) equation from the\nlast step into the (Subscript[p, 1]) equation\nand solve for (Subscript[p, 1])",StringJoin["(Subscript[p, 1])=",ToString[Expand[PA]/.pB->PB/.pA->(Subscript[p, 1]),StandardForm],"\n","(Subscript[p, 1])=",ToString[Expand[Round[pa,0.001]],StandardForm]]],AK[STEP5,5,"Find the optimal price for firm 2 to charge\n","Plug the (Subscript[p, 1]) equation from the\nlast step into the (Subscript[p, 2]) equation from step 3\nand solve for (Subscript[p, 2])",StringJoin["(Subscript[p, 2])=",ToString[Round[pb,0.001],StandardForm]]]},Alignment->Left]
],Button["New Problem",{AC=RandomInteger[{300,700}],BC=RandomInteger[{300,700}],BA=RandomInteger[{5,10}],BB=RandomInteger[{5,10}],CA=RandomInteger[{1,5}],CB=RandomInteger[{1,5}],MCA=RandomInteger[{1,100}],MCB=RandomInteger[{1,100}],STEP1=1,STEP2=1,STEP3=1,STEP4=1,STEP5=1}],{{STEP1,1,"Step 1"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP2,1,"Step 2"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP3,1,"Step 3"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP4,1,"Step 4"},{1->"Instruction",2->"Formula",3->"Answer"}},{{STEP5,1,"Step 5"},{1->"Instruction",2->"Formula",3->"Answer"}}
]