= Solution
The <function> is odd, so its constant and <cosine> coefficients are zero. Its <sine> coefficient is
$$
b_n=\frac2\pi I_n,\qquad I_n=\int_0^\pi(x^3-\pi^2x)\sin nx\,dx.
$$
The <polynomial> vanishes at both integration endpoints. Two <integrations by parts> therefore give
$$
I_n=\frac1n\int_0^\pi(3x^2-\pi^2)\cos nx\,dx
=-\frac1{n^2}\int_0^\pi6x\sin nx\,dx.
$$
One more integration yields
$$
\int_0^\pi x\sin nx\,dx
=\left[-\frac{x\cos nx}{n}+\frac{\sin nx}{n^2}\right]_0^\pi
=-\frac{\pi(-1)^n}{n}.
$$
Consequently $I_n=6\pi(-1)^n/n^3$ and $b_n=12(-1)^n/n^3$. Hence
$$
\boxed{g(x)=12\sum_{n=1}^\infty\frac{(-1)^n}{n^3}\sin nx,\qquad p=3}.
$$
The periodic continuation is <continuous> at $\pm\pi$, where its values are zero, so the series represents it there as well as in the open interval.
Back to article page