The budget constraint for group 1 is:
\(\omega_X P_X+\omega_Y P_Y \leqslant X P_X+Y P_Y\)
Where \(\omega_X=2 ; \omega_Y=0\)
 
Substituting the result from the Lagrangian \(\frac{P_X}{P_Y}=\frac{Y}{X}\) in the budget constraint to find the individual demand function:
\(2P_X=P_X X+ P_X X\)
\(X=1\)
And:
\(2P_X=P_Y Y + P_Y Y\)
\(Y=\frac{P_X}{P_Y}\)
The budget constraint for group 2is:
\(\omega_X P_X+\omega_Y P_Y \leqslant X P_X+Y P_Y\)
Where \(\omega_X=0 ; \omega_Y=2\)
 
Substituting the result from the Lagrangian \(\frac{P_X}{P_Y}=\frac{2Y}{X}\) in the budget constraint to find the individual demand function:
\(2P_Y=P_X X+ 0.5P_X X\)
\(X= \frac{4}{3} \frac{P_Y}{P_X}\)
And:
\(2P_Y=P_Y Y+ 2P_Y Y\)