Show that $\int_{0}^{2\pi} \cos (nx)\sin (x)dx=0$ using integration by parts, where $n \in \mathbb{N}$ My approach
Let $u = \cos(nx), dv = \sin(x)$, so that $du = -n\sin(nx)$, and $v = -\cos(x)$
$I = -cos(nx)cos(x) - \int_{0}^{2\pi}n\sin(nx)\cos(x)dx$
$I = -cos(nx)cos(x) - n\int_{0}^{2\pi}\sin(nx)\cos(x)dx$
$I = -cos(nx)cos(x) - n(\sin(nx)\sin(x) - n\int_{0}^{2\pi}\cos(nx)\sin(x)dx)$
$I = -cos(nx)cos(x) - n\sin(nx)\sin(x) + n^2I$
...
$I = \frac{\cos(nx)\cos(x) + n\sin(nx)sin(x)}{(n-1)(n+1)}$
I'm not sure where to go from here.
 A: Well since,$$\int \cos(nx)\sin(x){\rm d}x=\frac{\cos(x)\cos(nx)+n\sin(nx)\sin(x)}{(n-1)(n+1)}+C,$$
with $C$ an arbitrary constant, then $$\int_{0}^{2\pi}\cos(nx)\sin(x){\rm d}x=\left[\frac{\cos(x)\cos(nx)+n\sin(nx)\sin(x)}{(n-1)(n+1)}+C\right]_{x=0}^{x=2\pi}=-\frac{2\sin^{2}(n\pi)}{n^{2}-1}.$$
Using that,
$$\forall n\in \mathbf{N}: \quad -\frac{2\sin^{2}(n\pi)}{n^{2}-1}=0,$$
therefore
$$\forall n\in \mathbf{N}: \quad \int_{0}^{2\pi}\cos(nx)\sin(x){\rm d}x=0. \quad \blacksquare$$
A: If $F$ is an antiderivative of $f$,
$$ \int_a^b f(x) \mathrm{d}x= F(b) - F(a) $$
This is known as the Newton-Leibniz axiom.
Now that you have obtained the antiderivative, you just have to substitute the limits of integration to get the definite integral.
$$ \frac{\cos(nx)\cos(x) + n\sin(nx)sin(x)}{(n-1)(n+1)} \bigg \vert_{x=2\pi} =\frac{\cos(2n\pi)\cos(2\pi) + n\sin(2n\pi)sin(2\pi)}{(n-1)(n+1)} = \frac{1+0}{(n-1)(n+1)} = \frac1{(n-1)(n+1)} $$
$$ \frac{\cos(nx)\cos(x) + n\sin(nx)sin(x)}{(n-1)(n+1)} \bigg \vert_{x=0} =\frac{\cos(0)\cos(0) + n\sin(0)sin(0)}{(n-1)(n+1)} = \frac{1+0}{(n-1)(n+1)} = \frac1{(n-1)(n+1)}$$
$$ \therefore \int_{0}^{2\pi} \cos (nx)\sin (x) \mathrm{d}x = \frac1{(n-1)(n+1)} - \frac1{(n-1)(n+1)} = 0$$
A: \begin{eqnarray*}
            \int_{[0,2\pi]} \sin(mx)\cos(nx)dx      & = &       \int_{[0,2\pi]} \left(\frac{e^{mxi} - e^{-mxi}}{2i}\right) \left(\frac{e^{nxi} + e^{-nxi}}{2}\right) dx\\
                                                    & = &       \frac{1}{4i} \int_{[0,2\pi]} e^{(n+m)xi} - e^{-(n+m)xi} + e^{(m-n)xi} - e^{-(m-n)xi} dx\\
                                                    & = &       \frac{1}{2i} \left( \int_{[0,2\pi]} \frac{e^{(n+m)xi} - e^{-(n+m)xi}}{2i}dx + \int_{[0,2\pi]} \frac{e^{(m-n)xi} - e^{-(m-n)xi}}{2i}dx \right)\\
                                                    & = &       \frac{1}{2i}\left( \int_{[0,2\pi]} \sin((n+m)x)dx +  \int_{[0,2\pi]} \sin((m-n)x)dx \right)\\
                                                    & = &       \frac{1}{2i}\left( \left.\frac{\cos((n+m)x)}{n+m}\right|_{0}^{2\pi} + \left.\frac{\cos((m-n)x)}{m-n}\right|_{0}^{2\pi} \right)\\
                                                    & = &       0\quad \forall n,m\in\mathbb{N}
        \end{eqnarray*}
then considering $m = 1$ it concludes.
A: An easier solution involves the symmetry of the function rather than computing the anti derivative. Given the function $f(x)=\cos (nx)\sin x$, note that,
$$f(2\pi-x)=\cos (2n\pi-nx)\sin (2\pi -x)$$
$$f(2\pi-x)=-\cos (2n\pi-nx)\sin (x)$$
$$f(2\pi-x)=-\cos (nx)\sin (x)=-f(x)$$
If $I=\int_0^{2\pi} f(x)\, dx$, then we also have
$$I=\int_0^{2\pi} f(2\pi -x)\, dx$$
$$I=\int_0^{2\pi} -f(x)\, dx$$
$$I=-I$$
$$2I=0\implies\boxed{I=0}$$
