How can this integral be $0$?

202 Views Asked by At

Consider $$\int_0^{2\pi}\sin x(x+\cos x)\ dx$$ Now let $$t=\cos x,\hspace{1cm}-\sin x\ dx=dt$$ and the integral becomes $$-\int_1^1(\arccos t+t)dt$$ and this integral is obviously $0$. But this is wrong! The integral evaluates to $-2\pi$. So my substitution was not allowed, but why? Are there any restrictions on when one can apply trigonometric substitution?