This is where I get confused. The simplify
$$f(x) = \sum_{n = 0}^{\infty} c_n \phi_{n}(x)$$ which they then take out a factor of sum from n= 0 to infinity of $c_n$ which they simplify to $c_n$ and leave $\phi_n(x)$ in. How does the infinite sum become $c_n$?