<s>[INST] Calculate the integral $\int \frac{2-3x}{2+3x} \sqrt{\frac{1+x}{1-x}}dx$ I have to calculate the integral $\int \frac{2-3x}{2+3x} \sqrt{\frac{1+x}{1-x}}dx$. I tried the following substitutions: $x \rightarrow \frac{1+t}{1-t}, x \rightarrow \frac{1-t}{1+t}, x \rightarrow \frac{t^{2}+1}{t^{2}-1}$ but with no good result. Also I observed the symmetry in the integral, by $x\rightarrow\frac{x}{3}$. However I am unable to end it.
 [/INST] Hint The standard substitution for integrals like this, where the integrand includes $\sqrt{\frac{1 + x}{1 - x}}$, is simply $u = \sqrt{\frac{1 + x}{1 - x}}$. Rearranging and differentiating gives $$x = \frac{u^2 - 1}{u^2 + 1}, \qquad dx = \frac{4 u \,du}{(u^2 + 1)^2}.$$
So in our case, where the integrand is a product of $\sqrt{\frac{1 + x}{1 - x}}$ and a rational function of $x$, the substitution produces a rational function:
$$\int \frac{2 - 3 x}{2 + 3 x} \sqrt{\frac{1 + x}{1 - x}} \,dx = -\frac{4}{5} \int \frac{(u^2 - 5) u^2\,du}{(u^2 + 1)^2 (u^2 - \frac{1}{5})} .$$
As usual we apply the method of partial fractions, that is write the integrand as
$$\frac{(u^2 - 5) u^2}{(u^2 + 1)^2 (u^2 - \frac{1}{5})} = \frac{A u + B}{(u^2 + 1)^2} + \frac{C u + D}{u^2 + 1} + \frac{E}{u - \frac{1}{\sqrt{5}}} + \frac{F}{u + \frac{1}{\sqrt{5}}} .$$
With six parameters to solve for, this is a priori a computationally involved problem. But the left-hand side is an even function of $u$, so the right-hand side must be, too, which immediately gives $A = C = 0$, $F = -E$, so we only need to solve for three parameters:
$$\boxed{\frac{(u^2 - 5) u^2}{(u^2 + 1)^2 (u^2 - \frac{1}{5})} = \frac{B}{(u^2 + 1)^2} + \frac{D}{u^2 + 1} + \frac{E}{u - \frac{1}{\sqrt{5}}} - \frac{E}{u + \frac{1}{\sqrt{5}}}} .$$
(Instead of decomposing fully, we can also decompose
$$\frac{(u^2 - 5) u^2}{(u^2 + 1)^2 (u^2 - \frac{1}{5})} = \frac{B}{(u^2 + 1)^2} + \frac{D u}{u^2 + 1} + \frac{E'}{u^2 - \frac{1}{5}} ,$$
and then use the elementary integral $\int \frac{du}{u^2 - a^2} = \frac{1}{2 a }\log \left\vert\frac{u - a}{u + a}\right\vert + C$.)
Alternatively, as Lab pointed out in the comments, the form $\sqrt{\frac{1 + x}{1 - x}}$ suggests substitutions using various trigonometric identities, for example, $$\cot \theta = \pm \sqrt\frac{1 + \cos 2 \theta}{1 - \cos 2\theta} .$$
</s>