Fourier coefficients and series for $x\sin(x)$ Let $$g(x)=x \cdot \sin x,$$$x\in [-\pi,\pi)$ ($2\pi$-period).

*

*Find the Fourier coefficients $c_n(g)$ for all $n\in\mathbb{N}$ and write out the Fourier series for $g$.


I normally understood this as $c_n$ would be defined as $$c_n=\left\{\begin{matrix}
{a_0}/{2} & n=0 \\ 
(a_n-ib_n)/2 & n=1,2,...\\ 
(a_{-n}+ib_{-n})/2 & n=-1,-2,... 
\end{matrix}\right.$$
for the Fourier series $$f(t)=\frac{a_0}{2}+\sum_{n=1}^{\infty}\left [ a_n\cos nt +b_n\sin nt \right ]=\sum_{n=-\infty}^{\infty}c_ne^{int}$$
Now I am stuck. I am not sure on how to find these coefficients for all $n\in\mathbb{N}$ and afterwards writing up the series when from the definition of $c_n$ it appears that $c_n$ will vary.
 A: For $x\in [-\pi,\pi)$, one form of the Fourier series is
$$f(t)\sim\frac{a_0}{2}+\sum_{n=1}^{\infty}\left[ a_n\cos nt +b_n\sin nt\right] $$
The coefficients are given by
$$a_0 =\frac{1}{\pi} \int_{-\pi}^\pi f(t)  \, dt$$
$$a_n =\frac{1}{\pi} \int_{-\pi}^\pi f(t) \cos nt \, dt$$
$$b_n =\frac{1}{\pi} \int_{-\pi}^\pi f(t) \sin nt \, dt$$
This is equivalent to
$$f(t)\sim\sum_{n=-\infty}^{\infty} c_n e^{i n t}  $$
writing this out according to Euler's formula:
$$\begin{aligned} f(t) & \sim\sum_{n=-\infty}^{\infty} c_n \left[ \cos nt + i \sin nt \right]\\  & = c_0 + \sum_{n=1}^\infty\left[ (c_n+c_{-n})\cos nt + i(c_n - c_{-n}) \sin nt \right] \end{aligned}$$
Comparing terms,
$$c_0 = a_0/2$$
$$c_n + c_{-n} = a_n$$
$$c_n - c_{-n} = -i b_n$$
Solving for $c_n$ and $c_{-n}$:
$$c_0 = \frac{a_0}{2}$$
$$c_n  = \frac{a_n-i b_n}{2}$$
$$c_{-n} = \frac{a_n +ib_n}{2}$$
or
$$c_0 = \frac{1}{2\pi} \int_{-\pi}^\pi f(t) dt$$
$$c_n = \frac{1}{2\pi} \int_{-\pi}^\pi f(t) \left[ \cos nt - i\sin nt  \right] dt = \frac{1}{2\pi} \int_{-\pi}^\pi f(t)  e^{-int} dt$$
$$c_{-n} = \frac{1}{2\pi} \int_{-\pi}^\pi f(t) \left[ \cos nt + i\sin nt  \right] dt = \frac{1}{2\pi} \int_{-\pi}^\pi f(t)  e^{int} dt$$
