Specific solution of the wave equation I want to make sure I understood this question.
Solve the wave equation on the interval $(0 \leq x \leq \pi)$
$$u_{tt}-c^2u_{xx}=0$$
$$u(x,0) = x$$
$$u_t(x,0) = 1$$
$$u(0,t)=u_x(\pi,t)=0$$
Using separation of variables
$$u(x,t) = X(x)T(t) = XT$$
$$\frac{T''}{c^2 T} = \frac{X''}{X} = -\lambda = - \beta^2$$
We end up with 2 ODEs
$$X'' + \lambda X = 0$$
$$T''+c^2 \beta^2 T = 0$$
with the solutions
$$X(x) = A \cos \beta x + B \sin \beta x$$
$$T(t) = C\cos c\beta t + D \sin c\beta t$$
so 
$$u(x,t) = XT = (A \cos \beta x + B \sin \beta x)(C\cos c\beta t + D \sin c\beta t)$$
Applying boundary conditions
$$u(0,t) = A = 0$$
$$u(x,t) = XT = B \sin \beta x(C\cos c\beta t + D \sin c\beta t)$$
$$u_t(x,t) = c\beta B \sin \beta x (-C\sin c\beta t + D \cos c\beta t)$$
$$u_t(\pi,t) = 0 \therefore c\beta B\sin\beta \pi = 0$$
$$\beta_n = n-1/2$$
Thus,
$$u(x,t)=\sum_n \sin [(n-1/2) x](C_n\cos [c(n-1/2) t] + D_n \sin [c(n-1/2)t])$$
$$u(x,0) = x = \sum_n C_n \sin[(n-1/2)x]$$
I am confused here, am I suppose to calculate the coefficients according to
$$C_n = \int_0^\pi x \sin[(n-1/2)x] \mathrm{d}x$$
and similarly for $D_n$?
 A: You've made a mistake. You seem to have thought that $\sin(\beta \pi)=0$ iff $\beta\pi=(n-1/2)\pi$, which is not correct (Interestingly, it would be right if you were solving $\cos(\beta \pi)=0$). In fact, $\beta$ takes a simpler form:
$$\begin{align}\sin(\beta\pi)=0&\iff \beta\pi =n\pi\\&\implies \beta_n=n \end{align}$$
Thus, we have by the superposition principle:
$$u(x,t)=\sum_{n} \sin(nx)(C_n\cos(cnt)+D_n\sin(cnt))$$
You can find $C_n$ and $D_n$ easily using Fourier's trick:
$$u(x,0)=x=\sum_{n} C_n\sin(nx) \implies C_n=\frac{2}{\pi}\int_0^{\pi} x\sin(nx)~dx \tag{*}$$
And:
$$u_t(x,0)=1=\sum_n cD_n\cdot n\sin(nx) \implies \sum_n D_n\cdot n\sin(nx)=\frac{1}{c} \tag{1}$$
Multiplying both sides by $\sin(mx)$, where $m\in \mathbb{N}$ and integrating both sides from $0$ to $\pi$:
$$\frac{1}{c}\int_0^{\pi} \sin(mx)~dx=\sum_n D_n n\int_0^{\pi}\sin(nx)\sin(mx)~dx$$
Exploiting orthogonality (i.e. $\int_0^{\pi} \sin(nx)\sin(mx)~dx=\frac{\pi}{2}\delta_{mn}$) and completeness gives:
$$D_n=\frac{2}{\pi nc}\int_0^{\pi}\sin(nx)~dx \tag{**}$$
Note that you could also obtain $(**)$ by defining $E_n=D_n\cdot n$ on $(1)$ and then use standard results from Fourier series.
I will leave the evaluation of the integrals on $(*)$ and $(**)$ as an exercise.
