I encountered the following concern when teaching indefinite integrals. I believe that many of us may overlook this. May I be wrong?
Let's consider the following example.
Find the indefinite integral $$ I=\int\dfrac{dx}{x\sqrt{x^{2}-1}}. $$ Some of my students gave the following answer.
Let $t=1/x$ then $dx=-1/t^{2}dt$, so we get $$ I=\int\dfrac{-1/t^{2}dt}{\frac{1}{t}\sqrt{\frac{1}{t^{2}}-1}}=\int\dfrac{-dt}{\sqrt{1-t^{2}}}=-\arcsin\left(t\right)+C=-\arcsin\left(\frac{1}{x}\right)+C. $$
Sometimes, I accept this answer since it gives a quick general antiderivative. However, the problem here is that we should write $$ \int\dfrac{-1/t^{2}dt}{\frac{1}{t}\sqrt{\frac{1}{t^{2}}-1}}=\int\dfrac{-\left|t\right|dt}{t\sqrt{1-t^{2}}}. $$ Then we end up with the answer $$ \int\dfrac{dx}{x\sqrt{x^{2}-1}}=\begin{cases} -\arcsin\left(\dfrac{1}{x}\right)+C & \text{for }x>1,\\ \arcsin\left(\dfrac{1}{x}\right)+C & \text{for }x<-1. \end{cases} $$ In your teaching practice, how would you usually proceed?
PS. We may encounter the same issue in many other problems. For example, find $\int\sqrt{1-x^{2}}dx$. Then if we let $x=\sin\left(t\right)$ then $\sqrt{1-\sin^{2}\left(t\right)}$ should be $\left|\cos\left(t\right)\right|$. So now we need to explain a bit here to our naive students. Of course, avoiding these kinds of problems is the quickest way to make our teaching job easier. However, we need to prepare a good way of explanining or handing these types of problems. That's what I want to know.