Yes, algebraically there would be no problem in doing that if you wish. I was taught the equivalent notation:
If given $\displaystyle f\left(x_1,x_2 \right)$ subject to the constraint $\displaystyle g\left(x_1,x_2 \right)=p_1x_1+p_2x_2-m=0$, then we wish to solve the following system:
$\displaystyle f_{x_1}\left(x_1,x_2 \right)=\lambda\cdot g_{x_1}\left(x_1,x_2 \right)$
$\displaystyle f_{x_2}\left(x_1,x_2 \right)=\lambda\cdot g_{x_2}\left(x_1,x_2 \right)$
$\displaystyle p_1x_1+p_2x_2-m=0$
Then we draw an implied relationship between the two independent variables from the first to equations which we then use in the third to get the critical point(s).