# Subtle trig identities in integration

Suppose we want to calculate $$\int \frac{\sin x}{\sin(x+a)} \mathrm{d}x$$

The clever way to do this is by writing $$x$$ as $$(x+a)-a$$ and explanding the numerator after which the result directly follows. Here i am sharing my solution and though,my answer matches with the above procedure,i have a few doubts which i am presenting.

Let $$\sin(x+a)=u \implies x+a=\sin^{-1} u \implies \sin x=u\cos a-\cos\sin^{-1}u\sin a$$. From inverse trig, $$\cos\sin^{-1}u=\sqrt{1-u^2}$$. Again, $$\mathrm{d}x=\frac{\mathrm{d}u}{\cos(x+a)}=\frac{\mathrm{d}u}{\sqrt{1-u^2}}$$. So,our integral becomes $$\int \frac{u\cos a-\sqrt{1-u^2}\sin a}{u\sqrt{1-u^2}} \mathrm{d}u$$ $$=\cos a\int \frac{\mathrm{d}u}{\sqrt{1-u^2}}-\sin a\int \frac{\mathrm{d}u}{u}$$ and our answer follows directly from here. But here are my doubts :

This is an indefinite integration without any upper or lower limit, but i used $$x+a=\sin^{-1}u$$. Is it justified? Similarly i substituted $$\cos(x+a)$$ by $$\sqrt{1-\sin^2(x+a)}=\sqrt{1-u^2}$$. Is it justified here as well since $$\cos(x+a)$$ could be $$\sqrt{1-u^2}$$ or $$-\sqrt{1-u^2}$$ as well depending on where $$x+a$$ lies. Since there are no limits in indefinite integration problems,i think they are to be defined for all real values of $$x$$. But the substitutions i used are confined to some fixed intervals. So i would like to draw your kind attention to this and also would like your advice on WHY and WHERE are such substitutions justified or give us the correct answer in calculus.

• the integral doesn't make any sense without limits of integration. Also de value of $a$ is determinant to know what the value of the integral is. By example: if $\sin(x+a)=0$ in the interval of integration for some $a\neq 0$ then the integral doesn't exists at all Commented Jul 7, 2022 at 12:44
• I do not see a problem with $u$ substitution. Commented Jul 7, 2022 at 12:47

First of all, you have an incorrect assumption about indefinite integration. Many indefinite integrals are defined only on finite intervals. For example, $$\int \frac{\mathrm dx}{\sqrt{1-x^2}}$$ is defined only for $$-1\leq x\leq 1.$$
In your particular case, if you take the logarithm of $$|\sin(x+a)|$$ rather than just $$\sin(x+a),$$ you have a valid antiderivative within each of the intervals in which the integral is defined, which is to say, in any interval such that $$n\pi-a for integer $$n.$$ This is something that you can verify by differentiating your proposed antiderivative and comparing it with the original integrand.
Alternatively, you could keep track of all the possible cases during the $$u$$-substitution, but I think it's much simpler to check afterwards. If you get inconsistent results in some places you may then be able to correct them.
Because your integrand is not defined at $$x = n\pi-a,$$ your antiderivative could have different constants of integration on each side of one of those values of $$x,$$ and you cannot use your antiderivative to compute a definite integral from $$b$$ to $$c$$ where $$b < n\pi-a < c.$$