This is the original formula:

$\displaystyle p(\frac{p}{3w_1})^\frac{1}{2}x^\frac{1}{2}_2-w_1(\frac{p}{3w_1})^\frac{3}{2}x^\frac{1}{2}_2-w_2x_2$

This is how far I've gotten:

$\displaystyle \frac{2p}{3}(\frac{p}{3w_1})^\frac{1}{2}x^\frac{1} {2}_{2}-w_2x_2$

And this is the final answer I need to get to:

$\displaystyle (\frac{4p^3}{27w_1})^\frac{1}{2}x^\frac{1}{2}_2-w_2x_2$

Any help would be greatly appreciated, thank you!