Hi matlondon,
The third line is like $\displaystyle {\color{red}a}b+{\color{red}a}$
Just factor out the a, and you get a(b+1).
Do you see it?
$\displaystyle {\color{red}x_2^{\frac{1}{2}}}\left[\frac{w_2}{w_1}\right]+{\color{red}x_2^{\frac{1}{2}}}$
$\displaystyle {\color{red}x_2^{\frac{1}{2}}}\left(\frac{w_2}{w_1 }+{\color{red}1}\right)$