Show equivalence of different approaches to $\int\frac{\sin(x)dx}{1+\cos^2(x)}$

Given:
For the indefinite integral $$J = \displaystyle\int\dfrac{\sin(x)}{1+\cos^2(x)}\,dx,\,$$ one anti-derivative will be obtained via the substitution $$\,u=\cos(x)\,$$ and another anti-derivative will be obtained via the substitution $$\,u=\tan(x/2)\,$$. While the two anti-derivatives will appear to be incompatible, their equivalence will be explicitly shown via the generic definite integral $$\displaystyle\int_a^b\dfrac{\sin(x)}{1+\cos^2(x)}\,dx.$$

To Do:
As I will clarify at the end of this query, I am looking for an alternative (i.e. more implicit) way of demonstrating the equivalence of the two anti-derivatives, within a "constant of integration," other than evaluating the (generic) definite integral.

$$\underline{u=\cos(x)}$$
$$du = -\sin(x)dx \;\Rightarrow\; J \;=\; \displaystyle{\int} \dfrac{-du}{1+u^2}\, \;=\; -\arctan(u) \;=\; -\arctan[\cos(x)]$$
$$=\; \arctan[-\cos(x)].$$

$$\underline{u=\tan(x/2)}$$
$$x = 2\arctan(u), \;dx = \dfrac{2du}{1+u^2}, \;\sin(x) = \dfrac{2u}{1+u^2}, \;\cos(x)=\dfrac{1-u^2}{1+u^2}.$$

Under this substitution, $$J$$ will simplify to $$\,\displaystyle\int\dfrac{2u\,du}{1+u^4} \;=\; \arctan\left[\dfrac{-1}{u^2}\right]$$
$$= \;\arctan\left[\dfrac{-1}{\tan^2(x/2)}\right] \;=\; \arctan\left[\dfrac{-\cos^2(x/2)}{\sin^2(x/2)}\right] \;=\; -\arctan\left[\dfrac{1+\cos(x)}{1-\cos(x)}\right]\,.$$

$$\underline{\text{Definite integral for} \;u=\cos(x)}$$

$$\displaystyle J = \int_a^b\dfrac{\sin(x)dx}{1+\cos^2(x)}\,dx.\;$$ Let $$\;r_1 = \arctan[cos(a)]\;$$ and let $$\;s_1 = \arctan[cos(b)].$$

Then $$\;J \;=\; (r_1 - s_1).$$

$$\underline{\text{Definite integral for} \;u=\tan(x/2)}$$

$$\displaystyle J = \int_{\tan(a/2)}^{\tan(b/2)}\dfrac{2u\,du} {1+u^4}.\;$$ Let $$\;r_2 = \arctan\left[\dfrac{1}{\tan^2(a/2)}\right]\;$$ and let

$$\;s_2 = \arctan\left[\dfrac{1}{\tan^2(b/2)}\right].$$

Then $$\;J \;=\; (r_2 - s_2).$$

Equivalence of the two substitutions:
I will use the identity $$\;\tan (\alpha - \beta) \;=\; \dfrac{\tan(\alpha) - \tan(\beta)} {1 + \tan(\alpha)\tan(\beta)}\;$$ to demonstrate that
$$\;\tan(r_1 - s_1) \;=\; \tan(r_2 - s_2).$$
Although not rigorous, this strongly suggests that angle $$(r_1 - s_1) =\;$$ angle $$\;(r_2 - s_2).$$

$$\tan(r_1 - s_1) = \dfrac{\cos(a) - \cos(b)}{1 + \cos(a)\cos(b)}.$$

$$\tan(r_2 - s_2) = \dfrac {\dfrac{1+\cos(a)}{1-\cos(a)} - \dfrac{1+\cos(b)}{1-\cos(b)}} {1 + \left(\dfrac{1+\cos(a)}{1-\cos(a)}\right) \left(\dfrac{1+\cos(b)}{1-\cos(b)}\right)} \;=\; \dfrac{2[\cos(a) - \cos(b)]}{2[1+\cos(a)\cos(b)]}$$
$$=\; \tan(r_1 - s_1).$$

The real question:

Focusing on the indefinite integrals only (ignoring the definite integrals), the two anti-derivatives are $$\;-\arctan[cos(x)]\;$$ and $$\;-\arctan\left[\dfrac{1+\cos(x)}{1-\cos(x)}\right].$$ How does one demonstrate that these two anti-derivatives are (somehow) essentially the same?

• $$\frac{\pi}{4}+\arctan y=\arctan 1+\arctan y=\arctan \frac{1+y}{1-y}$$ Since $\frac{\pi}{4}$ is a constant, its derivative is $0$. (In the above $y= \cos x$ and $|y| \leq 1$ so we can use the arctangent addition formula). Nov 3 '18 at 2:47
• @YuriyS WOW, thanks. Nov 3 '18 at 2:51