# Integral of $\sin x \cos x$ using two methods differs by a constant?

$$\int \sin \theta\cos \theta~d \theta= \int \frac {1} 2 \sin 2\theta~ d \theta=-\frac {1} 4 \cos 2\theta$$ But, if I let $$u=\sin \theta , \text{ then }du=\cos \theta~d\theta$$ Then $$\int \sin \theta\cos \theta~d \theta= \int u ~ du =\frac { u^2 } 2 =\frac {1} 2 \sin^2 \theta$$ Since $$\sin^2 \theta =\frac {1} 2 - \frac {1} 2 \cos 2\theta$$ The above can be written as $$\int \sin \theta\cos \theta~d \theta= \frac {1} 2 \sin^2 \theta =\frac {1} 2 \left( \frac {1} 2 - \frac {1} 2 \cos 2\theta \right)=\frac {1} 4-\frac {1} 4 \cos 2\theta$$ Why are the two results differ by the constant $1/4$? Thank you.

-
Didn't your calculus instructor drum into your head to always write $+C$ when computing an indefinite integral? I guess your head could use a bit more drumming! – GEdgar Apr 23 '12 at 13:07
@Tony : Please notice my edits to your question. If you write 3\sin 5 in $\TeX$, the backslash on \sin not only prevents italicization, but also results in proper spacing before and after $\sin$, so you don't need to insert those spaces yourself. – Michael Hardy Apr 23 '12 at 14:57
@Michael Hardy, thank you very much for the useful info!! – Tony May 2 '12 at 2:43

That is, the correct way to write the answer to $\int f(x)dx$ (where $f$ is defined on a continuous area) is $g(x) + C$.
Note that $C-\dfrac{1}{4}\cos{2\theta}$ defines the same family of functions as $C+\dfrac{1}{4}-\dfrac{1}{4}\cos{2\theta}$.