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?
The integral is just a rational function in $M$; factoring out the constants and writing $a = (\gamma - 1)/2$, you can reduce the integral to $$\int_{M_1}^{M_2} \frac{(1 - M^2)}{(1 + aM^2)M^3} \, dM.$$ I'm sure you can proceed from here.
Edit: to simplify the integral, you can make the substitution $u = M^2$ and write $$\int \frac{1 - M^2}{(1 + aM^2)M^3} \, dM = \frac 12 \int \frac{1 - u}{(1 + au)u^2} \, du$$ to simplify the partial fraction process.