# How to convert this integral to an elliptic integral?

I am aware that the standard form(an elliptic integral of the first kind) is $$\int_0^{\theta} \frac{d\theta}{\sqrt{1-k^2\sin^2{\theta}}}$$ But I am always mystified on how to actually put an integral into that form. For example, I am working on an integral of the form $$\int_0^{\theta} \frac{d\theta}{\sqrt{1-a\cos{(\theta + \gamma)}}}$$ where $\gamma$ is a constant. This, when I put into wolfram alpha appearantly evaluates to $$\dfrac{2 \sqrt{\dfrac{a \cos(\theta + \gamma) - 1}{a - 1}}F(\dfrac{\theta + \gamma}{2}|\dfrac{2a}{a - 1})}{\sqrt{1 - a \cos (\theta + \gamma)}} + \text{constant}$$ Thank you in advance!

Note that we have $$I = \int_{0}^{\theta} \frac{d\theta}{\sqrt{1-a\cos(\theta + \gamma)}} = \frac{2}{\sqrt{1-a}}\int_{\frac{\gamma}{2}}^{\frac{\gamma + \theta}{2}} \frac{1}{\sqrt{1-\frac{2a\sin^2 u}{a-1}}} du$$
on substituting $u = \frac{\theta+\gamma}2$. Now, this is an incomplete elliptic integral of the first kind with value $$F\left(u \,\bigg \lvert \frac{2a}{a-1} \right)$$