While solving some problems of integration(indefinite) I came across some integrands which becomes a lot easier to integrate if numerator and denominator is multiplied by certain expressions. But what are the consequences to it? 3 examples(almost the same issue) are shown below:
Example-1: $$\int{\frac1 {1+\sin x} dx}$$
In this function if we multiply both numerator and denominator with $(1-\sin x)$, then it becomes lot easier to determine the integral. Here the initial function was defined at $x=\frac\pi 2$ but when we are transforming the function to $\frac{1-\sin x} {1-\sin^2 x}$ we are basically multiplying the numerator and denominator by $\frac0 0$ at $x=(4n+1)\frac\pi 2$. Moreover the new function is itself undefined at $x=(2n+1)\frac\pi 2$. So we have changed the domain of the function by transforming it. What are the consequences to such integrands? Considering this as an indefinite integration, isn't it completely wrong to solve this integral since we dont know the limits even though they represent the same graph but undefined at some more points than it used to?
Again if we transform the function from the expression of $\sin x$ to an expression of $\tan\frac x 2$ isn't it still wrong since at $x=\pi$ the expression becomes undefined?
Example-2:$$\int{\frac{(x^2+1)} {(x^4+1)} dx}$$
I was taught to solve this type of integrals by taking $x^2$ outside the parentheses as common. But isn't it wrong since we are just dividing the expression inside the parentheses by $x^2$ which could also equal $0$? The new function(transformed) is undefined at $x=0$ whereas for any real value of $x$ the initial function is defined.
Another question: is $f(x)=x^2-1=x(x-1)$ for all real values of $x$? I am asking this question because when we do take any term common or take it outside the parentheses, we usually divide the expression inside the parentheses with that term as I have mentioned above.
Example-3:$$\int{\frac1 {1+3\cos^2 x} dx}$$ Here if we replace with $\cos x$ with $\frac1 {\sec x}$ , will it be a right thing to do since we are again restricting the domain to a lesser number of possible values as the previous 2?
I am facing almost the same problem regarding all the 3 examples shown above. I know that all the transformed functions are graphically the same as their initial counterparts and if these were definite integrals having limits which don't include those points at which the transformed ones are undefined, then they would yield the same integral. But what if the limits include those points?(Again I am asking this question because I am considering that since the initial functions are defined at those points then there might be a function which has the same slope coinciding with the initial function at those points) Moreover these are indefinite integrals. It is to be noted that I were taught to solve integral in such ways at my school....there might be many other ways to do so but till now I am unaware of those. I just want to know whether this processes are legitimate or not and would yield the same output or no and what are their consequences.