So I was looking through my professor's solution for the following PDE problems and don't really understand where she gets these coefficients from. I've been doing the problems using integration and takes forever so I'd like to learn the way she answers these questions:
\begin{align} u_{tt} &= u_{xx}(x,t), 0 < x < 1, t >0 \\ u(0,t) &= 0, u(1,t) = 0, t > 0 \\ u(x,0) &= \sin(\pi x) + (1/2)\sin(3\pi x) + 3\sin(7 \pi x) \\ u_t(x,0) &= \sin(2\pi x), 0 < x < 1 \end{align}
So what she does is, she sets the $u(x,0) = \sum \sin(n \pi x) [ a_n \cos(cn \pi t) + b_n \sin(c n \pi t)]$
$$ \sin(\pi x) + (1/2)\sin(3\pi x) + 3\sin(7 \pi x) = u(x,0) = \sum a_n \sin(n\pi x)$$
Then she says that $$ a_1 = 1, a_3 = 1/2, a_7 = 3, a_2 = a _4 = a_5 = a_6 = 0, a_n = 0 | n > 7$$
Also in the same way: $$ \sin(2 \pi x) = u_t (x,0) = \sum b_n n \pi \sin(n \pi x) $$ $$ 2\pi b_2 = 1,b_n = 0, n \neq 2$$
Then the final solution is: $$ u(x,t) = \sin(\pi x) cos(\pi t) + (1/2) \sin(3 \pi x) \cos(3 \pi t) + 3 \sin (7 \pi x) \cos(7 \pi t) + \frac{1}{2\pi} \sin(2 \pi x) \sin(2 \pi t)$$
Where does she get her $a_n$ coefficient from? I understand where the $b_n$ comes from.