# A contradictory integral: $\int \sin x \cos x \, \mathrm dx$

I've been thinking about integration lately, and I've come up with a question that I'm not sure how to address. Consider $$\int \sin x\cos x \, \mathrm dx = - \int -\sin x \cos x \, \mathrm dx$$ I started with the integral on the left hand side, which suggests a typical $$u$$-substitution. Let $$u=\sin x$$ then $$\, \mathrm du=\cos x \, \mathrm dx$$. So the integral evaluates to $$\int \sin x\cos x \, \mathrm dx = \frac{\sin^2(x)}{2}$$ But the original integral also suggests an alternate substitution. Let $$u=\cos x$$ and then $$du=-\sin x \, dx$$. So now $$\int \sin x\cos x \, \mathrm dx =- \int -\sin x \cos x \, \mathrm dx= -\frac{\cos^2(x)}{2}$$ So now I have that the integral evaluates to two different functions. I've tried playing with some different trigonometric identities, but I haven't been able to show that this is true and I'm fairly certain I haven't had any success because the statement itself isn't true. What am I doing wrong? How do you evaluate $$\int \sin x\cos x \, \mathrm dx$$?

$$\frac12\sin^2x=-\frac12\cos^2x+\frac12$$