TITLE: Integral of $\sin x \cdot \cos x$
QUESTION [10 upvotes]: I've found 3 different solutions of this integral. Where did I make mistakes? In case there is no errors, could you explain why the results are different?
$ \int \sin x \cos x dx $
1) via subsitution $ u = \sin x $
$ u = \sin x; du = \cos x dx \Rightarrow \int udu = \frac12 u^2 \Rightarrow \int \sin x \cos x dx = \frac12 \sin^2 x $
2) via subsitution $ u = \cos x $
$ u = \cos x; du = -\sin x dx \Rightarrow -\int udu = -\frac12 u^2 \Rightarrow \int \sin x \cos x dx = -\frac12 \cos^2 x = -\frac12 (1 - \sin^2 x) = -\frac12 + \frac12 \sin^2 x $
3) using $  \sin 2x = 2 \sin x \cos x $
$ \int \sin x \cos x dx = \frac12 \int \sin 2x = \frac12 (- \frac12 \cos 2x) = - \frac14 \cos 2x = - \frac14 (1 - 2 \sin^2 x) = - \frac14 + \frac12 \sin^2 x  $
So, we have:
$$ \frac12 \sin^2 x \neq -\frac12 + \frac12 \sin^2 x \neq - \frac14 + \frac12 \sin^2 x  $$

REPLY [8 votes]: Antiderivatives are only unique up to adding a constant ('of integration'). If you were to stick limits in your integrals then you'd always get the same number.

REPLY [7 votes]: Note: You are calculating indefinite integral and constants can be anything(they may differ). In fact the general solution to that would be just $C+\dfrac{\sin^2 x}{2}$

REPLY [6 votes]: $$\frac{d\{f(x)+c\}}{dx}=f'(x)$$ for any arbitrary constant  $c$
$$\implies \int f'(x)dx=f(x)+d $$ for any arbitrary constant  $d$
So, in indefinite integral we can get answers which differ by some constant

REPLY [5 votes]: A primitive is unique up to a constant