How do you evaluate the integral $\dfrac{1}{\pi} \int_{-\pi}^\pi x\sin(nx)dx$ and How do you evaluate the integral $$\dfrac{1}{\pi} \int_{-\pi}^\pi x\sin(nx)dx$$
I am new to Fourier series and integration so need help here. I have no idea how to evaluate this integral. Can you do this steps by steps so I can follow and learn more?
Thank you!
PS: How do you make the integral sign larger with Latex?

Set $u(x)=x$ and $v^\prime(x)=\sin(nx)$. In other words, $v(x)=-\frac 1 n \cos(nx)$.
Then the integration by parts formula is
$$\int_a^b u(x)v^\prime(x)dx=\left[u(x)v(v)\right]_a^b-\int_a^bu^\prime(x)v(x)dx$$
In other words,
$$\begin{split}
\int_{-\pi}^\pi x\sin(nx)dx &= \left[ -\frac x n\cos(nx)\right]_{-\pi}^{\pi}+\frac 1 n\int_{-\pi}^\pi \cos(nx)dx\\
&= -\frac {2\pi} n
\end{split}$$
That's if $n\neq 0$. For $n=0$, the integral is $0$.
