Step 4: General solution

By superposition of all modes:

$\displaystyle \boxed{
u(x,t) = \sum_{n=1}^{\infty} b_n \,
\sin\Big(\frac{n\pi x}{L}\Big) \,
\exp\Big[-\Big(\frac{n\pi}{L}\Big)^2 t\Big]
}$ (8)

where the coefficients $b_n$ are determined from the initial condition.