General Equilibrium with Perfect Substitutes
To solve for competitive equilibrium, we can first find the demand :
Demand for commodity $X$ by A is $x_A = \frac{5}{p_x}$ if $p_x &lt; 1$, $x_A \in [0,5]$ if $p_x = 1$, $x_A = 0$ otherwise.
Demand for commodity $X$ by B is $x_B = \frac{(30p_x+5)}{2p_x}$.
Now we can equate demand and supply and solve for $p_x$.
$x_A + x_B = 30$ yields $p_x = \frac{1}{2}$.