You don't. You can just write (u^(2)-1)/sqrt(u) = u^(3/2) - u^(-1/2).

After integrating you get 2u^(5/2)/5 - 2u^(1/2)

Substituting back u=cos(x) gives you

2cos^(5/2)(x)/5 - 2cos^(1/2)(x)

which, if you rewrite cos^(5/2)(x) as cos^(2)(x)cos^(1/2)(x) is exactly what they got.