what is the value of $\int \sin(x)\cos(x)dx$? $\frac{\sin^2(x)}{2}$ or $\frac{-\cos^2(x)}{2}$ or $\frac{-\cos(2x)}{4}$ $\int \sin(x)\cos(x)dx = \frac{\sin^2(x)}{2}$ because
$$\frac{d}{dx}\frac{\sin^2(x)}{2}=\sin(x)\frac{\sin(x)}{dx}=\sin(x)\cos(x)$$
but also
$$\frac{d}{dx}\frac{-\cos^2(x)}{2}=-\cos(x)\frac{\cos(x)}{dx}=\sin(x)\cos(x)$$
Moreover
$$\int \sin(x)\cos(x)dx = \int \frac{\sin(2x)}{2}dx = \frac{-\cos(2x)}{4} = \frac14 -  \frac{\cos^2(x)}{2} = \frac{\sin^2(x)}{2} - \frac14 $$
It's true that $\frac{\sin^2(x)}{2}$ and $\frac{-\cos^2(x)}{2}$ are not equal so what is that problem I made here.
 A: You are forgetting the constant of integration.  The constant of integration will change depending on whether you chose to integrate the sine or the cosine.  The bottom line is that the integrals are the same.
A: $\displaystyle \int \sin x\cos xdx = \displaystyle \int \dfrac{\sin 2x}{2}dx = -\dfrac{\cos 2x}{4}+C$
A: Since
$$
\frac{\sin^2x}{2}-\frac{-\cos^2}{2}=
\frac{\sin^2x+\cos^2x}{2}=\frac{1}{2}
$$
we see that the functions
$$
f(x)=\frac{\sin^2x}{2}\qquad
g(x)=\frac{-\cos^2x}{2}
$$
have the same derivative.
Similarly,
$$
\frac{\sin^2x}{2}-\frac{-\cos2x}{4}=
\frac{2\sin^2x+\cos2x}{4}=
\frac{2\sin^2x+\cos^2x-\sin^2x}{4}=\frac{1}{4}
$$
so also
$$
h(x)=\frac{-\cos2x}{4}
$$
has the same derivative as $f$ and $g$.
For the following discussion, I'll assume we're dealing with continuous functions defined on intervals, so they have an antiderivative over that interval.
The problem is that there is not the antiderivative of a function: when you find one, any other function differing with this by a constant is an antiderivative as well.
In some cases it seems we're able to use a “better” one, say $x\mapsto x^2$ for an antiderivative of $x\mapsto 2x$, but this is just because we're dealing with polynomials.
Here's a proof that there's really no good reason for choosing $0$ as the constant term. An antiderivative of $x\mapsto 2x+2$ might be chosen to be $x\mapsto x^2+2x$, according to the “better” choice. Nonetheless, computing the integral as
$$
\int(2x+2)\,dx=2\int(x+1)\,dx=2\int t\,dt=t^2=(x+1)^2=x^2+2x+1
$$
(with the substitution $t=x+1$) we see that our “better” choice gives “inconsistent” results.
Are they really inconsistent? Of course not! We've got two distinct antiderivatives, which however, according to the theory, differ by a constant.
In the case of trigonometric functions, there's a wealth of identities that can mask the constant of integration, as in your examples.
