On changing limits of integration when there are domain problems. As an example say I have $$\int_{\pi/2}^\pi \frac{2}{1- \sin(2x)} dx$$
I would like to perform the substitution $2x = \arcsin(u)$ but I notice this would not be surjective on the interval given by the extremes of integration.
So, to solve the problem, I say instead of having the domain of $\sin(x)$ be $[0, 2 \pi]$ let it be $[3 \pi/2, 7 \pi/2]$ in this way $\arcsin(u)$ will take values in $[\pi, \pi/2]$.
But now performing the substitution I obtain
$$\int_{1}^{-1} \frac{1}{((1-u)(\sqrt{1-u^2})} du$$
That does not give the same values of the original integral that evaluates to $2$. Where is the mistake in my reasoning?

Your domain of integration should not extend to 1. Instead, work with
$\int_{\pi/2}^{3\pi/4}  \frac{2}{1 - \sin(2x)} dx+ \int_{3\pi/4}^{\pi}\frac{2}{1 - \sin(2x)} dx$ such that your substitution of arcsin is well-defined.
Given $x \in [\pi/2, 3\pi/4]$, we know that $\cos(2x)$ is non-positive, so it must be the case that $du = 2\cos(2x) dx = -2\sqrt{1 - \sin^2(2x)} dx = -2\sqrt{1 - u^2} dx$. I feel that this subtlety may have been neglected in your derivation.
