Setting the Lagrangian for the first 50% of the population:
\(\mathcal{L}=ln(X+R)+ln(Y)+\lambda[P_x(1+R)+P_Y-X P_X-Y P_Y]\)
F.O.C:
\(\frac{\partial \lambda}{\partial X} = 0= \frac{1}{X+R} -\lambda P_X\)
\(\frac{\partial \lambda}{\partial Y} = 0= \frac{1}{Y} -\lambda P_Y\)
\(\frac{P_X}{P_Y}=\frac{Y}{X+R}\)
Substituting in the budget constraint to find the individual demand function:
\(P_X(1+R)+P_Y=P_X X+ P_X X\)
\(X=0.5+0.5\frac{P_Y}{P_X}\)
X here is the quantity bought while the quantity consummed by the first kind of agents is equal to X+R.
The demand curve for Y is:
\(Y=0.5+0.5\frac{P_X}{P_Y}\)