# Integral of $\sin x \cdot \cos x$ [duplicate]

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$$

• Ahh! I always give this problem in my first year calculus course. – Jyrki Lahtonen May 4 '13 at 14:40
• $+C$... ${}{}{}$ – David Mitra May 4 '13 at 14:40
• $*$ is usually used for convolution in this context. I removed it. – Ayman Hourieh May 4 '13 at 14:42
• @AymanHourieh: Didn't I? – Inceptio May 4 '13 at 14:44
• @Inceptio Check the edit history. I edited the body; you edited the title. – Ayman Hourieh May 4 '13 at 14:49

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.

• Oh, yes. I checked it with 0 and \pi/2 and those 'strange' fractions deducted each other. Thank you – Jimch May 4 '13 at 14:46

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}$

$$\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

A primitive is unique up to a constant