I'm not sure as to how the book got from:
$dx=\frac{a+b}{2}\int{\sqrt{\frac{1+\cos(\theta)}{1-\cos(\theta)}}\sin(\theta)d\theta}$
to:
$x=\frac{a+b}{2}(\theta-\sin(\theta))+constant$
where $a$ and $b$ are constants.
I have tried the substitution of $u=\cos\theta$ among other ones and integration by parts. Not sure what's meant to happen because my answers are way too complex and differ by more than a constant. Do you integrate twice?
Edit: I believe there might have been an error in the printing of the question. This seems to be what was intended: $dx=\frac{a+b}{2}\int{\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}}\sin(\theta)d\theta}$
Multiply divisor and dividend with $\sqrt{1+\cos(\theta)}$: $$ \int \sqrt{\frac{1+\cos(\theta)}{1-\cos(\theta)}}\sin(\theta)d\theta = \int \frac{1+\cos(\theta)}{\sqrt{1-\cos^2(\theta)}}\sin(\theta)d\theta = \int (1+\cos(\theta)) d\theta = \theta + \sin(\theta) $$
There seems to be a sign error in the expression you have — or have I made a sign error that I cannot see right now?