conditional factor demand functions for capital and labor I don't how to put maths in here so using an image:
$$(\frac{r}{w} \frac{1-\alpha}{\alpha})*K$$
$$\equiv (\frac{r}{w} \frac{1-\alpha}{\alpha})[\frac{y}{a}(\frac{w}{r} \frac{\alpha}{1-\alpha})^{1-\alpha}]$$
$$\equiv (\frac{r}{w} \frac{1-\alpha}{\alpha})^{\alpha-1+1} \frac{y}{a}$$

$$\equiv (\frac{r}{w} \frac{1-\alpha}{\alpha})^{\alpha} \frac{y}{a}$$

Is that what you're looking for?  Just notice that between steps two and three, I inverted the part of K in parentheses and changed the exponent to account for the inversion.