I have been given the following problem;
Find the formal solution of the problem
$u_{tt}=u_{xx}$, $0<x<\pi$,$t>0$
$u(0,t)=u(\pi,t)=0$, $t\ge 0$
$u(x,0)=\sin^3(x)$, $0\le x \le \pi$
$u_t(x,0)=\sin(2x)$, $0 \le x \le \pi$
I began by finding the general form of this equation, being $u(x,t)=\sum_{n=1}^{\infty}\big(A_n\cos(\frac{n\pi c t}{l})+B_n\sin(\frac{n\pi ct}{l})\big)\sin(\frac{n\pi x}{l})$
Then, letting $l=\pi$ and $c=1$, i obtained the equation to my problem $u(x,t)=\sum_{n=1}^{\infty}\big(A_n\cos(nt)+B_n\sin(nt)\big)\sin(nx)$
Now, plugging in the condition is where i hit a wall. Plugging in $u(x,0)=\sin^3(x)$ I got
$u(x,0)=\sum_{n=1}^{\infty}A_n\sin(nx)=\sin^{3}(x)$. My notes say this is equal to $-\frac{1}{4}\sin(3x)+\frac{3}{4}sin(x)$, but i cant for the life of me see how this is obtained. Any help would be much appreciated.
\begin{align} \sin^3(x) &= \ \frac{1}{(2i)^3}\left(e^{ix} - e^{-ix}\right)^3\\ &= -\frac{1}{8i}\left(e^{3ix} - 3e^{ix}+3e^{-ix}-e^{-3ix}\right)\\ &= -\frac{1}{4}\cdot\frac{1}{2i}\left(e^{3ix} - e^{-3ix}\right)+\frac{3}{4}\cdot\frac{1}{2i}\left(e^{ix} - e^{-ix}\right)\\ &=-\frac{1}{4}\sin(3x) + \frac{3}{4}\sin(x) \end{align}
This gives you the coefficients of your Fourier series expansion. Since $\sin^3(x)$ is itself periodic, the Fourier series becomes a finite sum with (in this case) only two terms.