This integral is given without proof/detail in the textbook Modern Compressible Flow by John Anderson. The ratio of specific heats, $\gamma$, is a positive and constant real number.
$\int_{M_1}^{M_2}\frac{2}{\gamma M^2}(1-M^2)\left[1+\frac{1}{2}(\gamma-1)M^2\right]^{-1}\frac{dM}{M}=\left[-\frac{1}{\gamma M^2}-\frac{\gamma+1}{2\gamma}\ln\left(\frac{M^2}{1+\frac{\gamma-1}{2}M^2}\right)\right]_{M_1}^{M_2}$
But I can't figure out how to integrate it. My initial thought is that integration by parts was used, but I haven't had any luck. I also tried a few different substitutions such as $u=1+\frac{1}{2}(\gamma-1)M^2$, so $du=(\gamma -1)MdM$, but that clearly doesn't work.
How can I integrate the given expression?