For the integral $$\int 2 \cos x \sin x \text{d}x,$$ a $u$-substitution with $u = \sin x$ leads to $$\int 2 u \text{d}u = 2 \cdot \frac{u^2}{2}+C= u^{2}+C = \sin ^{2}x + C.$$ On the other hand, using the double-angle formula $2 \sin x \cos x = \sin \left(2x\right)$, the original integral can be evaluated as $$\int \sin \left(2x \right)\text{d}x = -\frac{\cos \left(2x\right)}{2}+D.$$ I was expecting to be able to find a relationship between the two antiderivatives in the following way: $$\sin ^{2} x = -\frac{\cos \left(2x\right)}{2}+E.$$ But $\sin ^{2} x +\frac{\cos \left(2x\right)}{2}$ is not a constant.
The reason that I was expecting to be able to find a relationship between the two answers due to the fact that they are general solutions to the ODE $y' = 2\sin x \cos x$ and that transitivity of equality should imply that the two antiderivatives are equal.