<s>[INST] How can one evaluate the integral $\int\sqrt{\frac{1-ax}{1-x}}\ dx$? How can I evaluate the following integral:
$$\int\sqrt{\frac{1-ax}{1-x}}\ dx?$$
Here $a$ is a positive constant. I know that the function 
$$\sqrt{\frac{1-ax}{1-x}}$$
has a primitive, but I don't know how to find it.
 [/INST] The standard way for these integrals is to use substitution: set
$$y^2=\frac{1-ax}{1-x}=a+\frac{1-a}{1-x},\enspace y>0,\enspace\text{whence}\enspace \mathrm 2y\, d\mkern1mu y=\frac{1-a}{(1-x)^2}\mathrm d\mkern1mu x$$
so that
$$\mathrm d\mkern1mu x =2y\frac{(1-x)^2}{1-a}y=\frac{2(1-a)y}{(y^2-a)^2}\mathrm d\mkern1mu y$$
and finally 
\begin{align*}\int\sqrt{\frac{1-ax}{1-x}}\,\mathrm d\mkern1mu x&=2(1-a)\int \frac{y^2}{(y^2-a)^2}\,\mathrm d\mkern1mu y=2(1-a)\int \frac{\mathrm d\mkern1mu y}{y^2-a}+2a(1-a)\int \frac{\mathrm d\mkern1mu y}{(y^2-a)^2}\\
&=\frac{1-a}{\sqrt a}\,\ln\biggl(\frac{y-\sqrt a}{y-\sqrt a}\biggr)\end{align*}
Now use partial fractions:$$\frac{y^2}{(y^2-a)^2}=\frac A{y-\sqrt a}+\frac B{y+\sqrt a}+\frac C{(y-\sqrt a)^2}+\frac D{(y+\sqrt a)^2}$$


*

*For symmetry reasons, one has $A=-B$, $C=D$.

*Multiplying both sides by $(y-\sqrt a)^2$ and setting $y=\sqrt a$ shows $\,C=D=\dfrac14$.

*Setting $y=0\,$ leads to $A=-B=\dfrac1{4\sqrt a}$
Thus
\begin{align*}\int \frac{y^2}{(y^2-a)^2}\,\mathrm d\mkern1mu y&=\dfrac1{4\sqrt a}\,\ln\biggl(\frac{y-\sqrt a}{y+\sqrt a}\bigg)-\frac14\biggl(\frac1{y-\sqrt a}+\frac1{y+\sqrt a}\biggr)\\
&=\dfrac1{4\sqrt a}\,\ln\biggl(\frac{y-\sqrt a}{y+\sqrt a}\bigg)-\frac y{2(y^2-a)}\\
&=\dfrac1{4\sqrt a}\,\ln\biggl(\frac{\sqrt{1-ax}-\sqrt{a(1+ax)}}{\sqrt{1-ax}+\sqrt{a(1+ax)}}\biggr)-\frac{\sqrt{(1-x)(1-ax)}}{2(1-a)}.
\end{align*}

</s>