Step 1: The wave equation is \(u_{tt} = c^2 u_{xx}\) with \(c^2 = 4\), so \(c = 2\). The string has length \(L = 1\) with fixed ends: \(u(0,t) = u(1,t) = 0\).
Step 2: Use separation of variables: assume \(u(x,t) = X(x)T(t)\). Substituting into the PDE gives
\[\frac{T''(t)}{c^2 T(t)} = \frac{X''(x)}{X(x)} = -\lambda^2\]Step 3: The spatial equation \(X'' + \lambda^2 X = 0\) with \(X(0) = X(1) = 0\) has eigenfunctions
\[X_n(x) = \sin(n\pi x), \qquad \lambda_n = n\pi, \quad n = 1,2,3,\dots\]Step 4: The temporal equation \(T'' + c^2\lambda_n^2 T = 0\) gives
\[T_n(t) = A_n\cos(n\pi c t) + B_n\sin(n\pi c t)\]Step 5: The general solution is a superposition
\[u(x,t) = \sum_{n=1}^{\infty}\left[A_n\cos(n\pi c t) + B_n\sin(n\pi c t)\right]\sin(n\pi x)\]Step 6: Apply \(u(x,0) = \sin(\pi x)\). This matches only the \(n=1\) term, so \(A_1 = 1\) and all other \(A_n = 0\).
Step 7: Apply \(u_t(x,0) = 0\). Since \(u_t(x,0) = \sum n\pi c B_n \sin(n\pi x) = 0\) for all \(x\), every \(B_n = 0\).
Step 8: With \(c = 2\), the solution reduces to
\[u(x,t) = \cos(\pi c t)\sin(\pi x) = \sin(\pi x)\cos(2\pi t)\] \[\boxed{u(x,t) = \sin(\pi x)\cos(2\pi t)}\]