(* Consumer Indifference Threshold *)
FullSimplify[Solve[pI +(((x-λI))^2)t==pE+((((1-λE)-x))^2)t,{x}]]

FullSimplify[(-(((-1+λE))^2)+((λI)^2))/(-1+λE+λI)]

(* Duopoly profts and solutions to first-order conditions *) profitI=(pI-c)((-pE+pI+t (-(((-1+λE))^2)+((λI)^2)))/(2 t (-1+λE+λI)));
profitE=(pE-c)(1-((-pE+pI+t (-(((-1+λE))^2)+((λI)^2)))/(2 t (-1+λE+λI))));
FullSimplify[Solve[D[profitI,pI]==0,pI]]
FullSimplify[Solve[D[profitE,pE]==0,pE]]

(* Second-order conditions *)
D[profitI,{pI,2}]
D[profitE,{pE,2}]

(* Bertrand equilibrium *)
FullSimplify[Solve[pI==(1/2) (c+(1/2) (c+pI+t (-((λE)^2)+(((-1+λI))^2)))+t ((((-1+λE))^2)-((λI)^2))),pI]]
FullSimplify[Solve[pE==(1/2) (c+(1/2) (c+pE+t ((((-1+λE))^2)-((λI)^2)))+t (-((λE)^2)+(((-1+λI))^2))),pE]]

(* Difference between equilibrium prices *)FullSimplify[(1/3) (3 c+t (-3+λE-λI) (-1+λE+λI))-(1/3) (3 c-t (3+λE-λI) (-1+λE+λI))]

(* Individual profits in Bertrand equilibrium *)profitI=FullSimplify[((1/3) (3 c+t (-3+λE-λI) (-1+λE+λI))-c)(1/(2 t (-1+λE+λI)))(-(1/3) (3 c-t (3+λE-λI) (-1+λE+λI))+(1/3) (3 c+t (-3+λE-λI) (-1+λE+λI))+t (-(((-1+λE))^2)+((λI)^2)))]
profitE=FullSimplify[((1/3) (3 c-t (3+λE-λI) (-1+λE+λI))-c)(1-(1/(2 t (-1+λE+λI)))(-(1/3) (3 c-t (3+λE-λI) (-1+λE+λI))+(1/3) (3 c+t (-3+λE-λI) (-1+λE+λI))+t (-(((-1+λE))^2)+((λI)^2))))]

(* Total profits in Bertrand equilibrium *)FullSimplify[profitI+profitE]

(* Existence of Bertrand equilibrium with all consumers buying *)U0=s-(1/3) (3 c+t (-3+λE-λI) (-1+λE+λI))-((λI)^2)t;U1=s-(1/3) (3 c-t (3+λE-λI) (-1+λE+λI))-((λE)^2)t;
Ux0=s-(1/3) (3 c+t (-3+λE-λI) (-1+λE+λI))-((((1/(2 t (-1+λE+λI)))(-(1/3) (3 c-t (3+λE-λI) (-1+λE+λI))+(1/3) (3 c+t (-3+λE-λI) (-1+λE+λI))+t (-(((-1+λE))^2)+((λI)^2)))-λI))^2)t;
Ux1=s-(1/3) (3 c-t (3+λE-λI) (-1+λE+λI))-(((1-λE-(1/(2 t (-1+λE+λI)))(-(1/3) (3 c-t (3+λE-λI) (-1+λE+λI))+(1/3) (3 c+t (-3+λE-λI) (-1+λE+λI))+t (-(((-1+λE))^2)+((λI)^2)))))^2)t;
Solve[U0==0,s]
Solve[U1==0,s]
Simplify[Solve[Ux0==0,s]]
Simplify[Solve[Ux1==0,s]]

FullSimplify[(3 -4 λE+((λE)^2)-2 λI+2 ((λI)^2))/(1-λE-λI)]
FullSimplify[(3-2 λE+2 ((λE)^2)-4 λI+((λI)^2))/(1-λE-λI)]
FullSimplify[(45+13 ((λE)^2)-54 λI+13 ((λI)^2)+2 λE (-27+5 λI))/(1-λE-λI)]

FullSimplify[(3 c+3 t-4 t λE+t ((λE)^2)-2 t λI+2 t ((λI)^2))- (3 c+3 t-2 t λE+2 t ((λE)^2)-4 t λI+t ((λI)^2))]

FullSimplify[Solve[41+3 λE-13 λI-((4 (((1-2 λE))^2))/(-1+λE+λI))==0,λE]]
FullSimplify[Solve[41+3 λE-13 λI-((4 (((1-2 λE))^2))/(-1+λE+λI))==0,λI]]

(* Middle range of consumers buys if the following condition is strictly positive *)FullSimplify[2λI-(1/(2 t (-1+λE+λI)))(-(1/3) (3 c-t (3+λE-λI) (-1+λE+λI))+(1/3) (3 c+t (-3+λE-λI) (-1+λE+λI))+t (-(((-1+λE))^2)+((λI)^2)))]
FullSimplify[2λE-1+(1/(2 t (-1+λE+λI)))(-(1/3) (3 c-t (3+λE-λI) (-1+λE+λI))+(1/3) (3 c+t (-3+λE-λI) (-1+λE+λI))+t (-(((-1+λE))^2)+((λI)^2)))]