While looking at the solution here: https://www.stumblingrobot.com/2015/12/01/evaluate-the-integral-of-axa-x12/
Evaluate the following integral for $a>0$. $$\newcommand{\dd}{\; \mathrm{d}} \int\sqrt{\frac{a+x}{a-x}} \dd x.$$ First, we multiply the numerator and denominator in the fraction inside the square root by $a+x$ and do some simplification, \begin{align*} \int \sqrt{\frac{a+x}{a-x}} \, dx &= \int \sqrt{\frac{(a+x)^2}{(a-x)(a+x)}} \, dx \\[9pt] &= \int \frac{a+x}{\sqrt{a^2-x^2}} \, dx \\[9pt] &= \int \frac{a}{\sqrt{a^2-x^2}} \,dx + \int \frac{x}{\sqrt{a^2-x^2}} \, dx \\[9pt] &= \int \frac{1}{\sqrt{1 - \left( \frac{x}{a} \right)^2}} \, dx + \int \frac{x}{\sqrt{a^2-x^2}} \, dx. \end{align*} Now, we evaluate these two integrals separately. ...
I wondered why it is fine to multiply the numerator and denominator by $(a+x)$?
In the original integrand, the square root has to be non-negative and the denominator has to be non-0, so $x \in [-a, a)$. Therefore, the end point $-a$ is still in the domain of the integrand, but it is not in the domain of the new integrand when we extend it with $(a+x)/(a+x)$, so I'm not sure why exactly that is justified.
If that's justified, please explain why. If that's not justified, please provide a full correct solution.