The first order conditions equate marginal revenue per factor to the price of that factor: \begin{align} p\cdot\alpha\frac{y}{x_1} &= w_1\\ p\cdot\beta\frac{y}{x_2} &= w_2, \end{align} Where I used the property of power function $(x^n)'_n = n \frac{x^n}{x}$. Divide the second FOC by the first to get the relation between the relative prices and the relative factor demands: $$\frac{\beta}{\alpha}\frac{x_1}{x_2} = \frac{w_2}{w_1}. \tag{A}$$ From this relation we can draw two conclusions: 1. Rewrite (A) in log form: $$- \ln \frac{x_2}{x_1} + \ln \frac{\beta}{\alpha} =\ln \frac{w_2}{w_1},$$ And using the log definition of elasticity $\epsilon_y^x = \frac{\mathrm{d}\ln y}{\mathrm{d}\ln x}$ we come to the conclusion, that relative factor demand is decreasing in relative factor prices with unit elasticity: $$\frac{\mathrm{d}\ln x_2/ x_1}{\mathrm{d}\ln w_2/w_1} = -1.$$ 2. Multiply both sides of (A) by $\frac{x_2}{x_1}$ : $$\frac{\beta}{\alpha} = \frac{w_2x_2}{w_1x_1}. \tag{B}$$ Rearrangement (B) says that the expenditures on different factors are proportional to their respective input elasticities, i.e. if our total spending on factor 1 is $\$\alpha$ then we must spend $\$\beta$ on factor 2. The total cost $C$ is allocated in the same proportion, i.e. for a general Cobb-Douglas production function, spending on factor 1 is $$w_1 x_1 = \frac{\alpha}{\alpha+\beta}C,$$ or simply $w_1 x_1 =\alpha C$ if $\alpha+\beta=1$, i.e. if the production function is homogeneous of degree 1.