So I have to demonstrate how to solve $u_{tt} = c^2 u_{xx}$, where $u(0, t) = u(L, t) = u_t(x, 0) = 0$, $$u(x, 0) = f(x) = \begin{cases} 2x/L, &x \in [0, L/2]; \\ 2(L-x)/L, &x \in (L/2, L]. \end{cases}$$ Somehow it's similar to this problem but we don't know the wave speed $c$ and the initial condition $f(x)$ is different.
By using d'Alembert formula, I should get $u(x, t) = 0.5(f(x - ct) + f(x + ct))$ but when I plug in $f(x)$ the solution reduces to $f(x)$ itself. The Fourier series expression has $\cos(n \pi c t/L)$, so I doubt I missed something when I use the formula to find $u(x, t)$. Any insights?