Fourier expansion to solve wave equation I have the wave equation, $c^{-2}u_{tt}=u_{xx}$ on a bounded domain $0<x<L$, with boundary conditions $u(0,t)=0=u(L,t)$, and initial conditions $u(x,0)=f(x)$ and $u_t(x,0)=g(x)$.
To solve, I let $u(x,t)=F(x)G(t)$, plug it in and rearrange to get $\frac{F''}{F}=\frac{G''}{c^2G}=\lambda$.
To make a long story short, I do all the plugging in of BC's and then apply the boundary conditions to arrive at: 
$$u(x,0)=\sum\limits_{n=1}^\infty E_n\sin(\frac{n\pi x}{L})   =f(x)$$
and 
$$u_t(x,0)=\sum\limits_{n=1}^\infty \frac{n\pi c}{L}D_n \sin(\frac{n \pi x}{L})=g(x)  $$
I know we are supposed to use fourier expansion to solve for the exponents, but how would I go about doing this? Do I need an actual function, not just f and g to solve this?
 A: I think I did this correctly, but I'm not 100% sure.
The Fourier expansion is $$f(x)=\sum\limits_{n=1}^\infty A_n\cos(\frac{n\pi x}{L}) + \sum\limits_{n=1}^\infty B_n\sin(\frac{n\pi x}{L})$$
where $$A_0=\frac{1}{L} \int_{-L}^L f(x)dx, \ \ A_n=\frac{2}{L}\int_{-L}^Lf(x)\cos(\frac{n\pi x}{L})dx, \ \ B_n=\frac{2}{L}\int_{-L}^Lf(x)\sin(\frac{n\pi x}{L})dx$$
Since $u(x,0)=f(x)=\sum\limits_{n=1}^\infty E_n\sin(\frac{n\pi x}{L})$, this means $E_n$ is the exact same thing as $B_n$ above, correct?
And since $u_t(x,0)=g(x)=\sum\limits_{n=1}^\infty \frac{n\pi c}{L}D_n\sin(\frac{n\pi x}{L})$, $\ \ $ then $\frac{n\pi c}{L}D_n=\frac{2}{L}\int_{-L}^Lg(x)\sin(\frac{n\pi x}{L})dx$
Right? Did I miss anything?
A: Let $$f(x) = \sum_{n = 1}^\infty A_n \sin( \frac{n \pi }{L}) \text{ for } 0 < x < L $$
To solve for the fourier coefficients, we want to adapt the solution we already know from solving on a symmetric interval.
Let $f^*(x)$ be the odd extension of $f(x)$. That is to say
$$f^*(x) = f(x) \text{ for } x > 0$$
$$f^*(x) = -f(-x) \text{ for } x < 0$$
If we replace $f$ in the above sum with $f^*$, multiply by $\sin( \frac{n' \pi x}{L})$ and integrate from $-L$ to $L$,
Then
$$A_n = \frac{1}{L} \int_{-L}^{L} f^*(x) \sin(\frac{n \pi x}{L}) dx = \frac{2}{L} \int_{0}^{L} f^*(x) \sin(\frac{n \pi x}{L}) dx = \frac{2}{L} \int_{0}^{L} f(x) \sin(\frac{n \pi x}{L}) dx $$
Since $f^*(x) \sin(\frac{n \pi x}{L})$ is an even function and $f^*(x) = f(x)$ for $x>0$
The above is how you adapt your knowledge of Fourier coefficients to the half line. 
