# Specific solution to the $1D$ wave equation

So my current solution to the $1D$ wave equation is (with my given boundary and initial conditions): $$y(x,t) = \sum_{n=1}^\infty C_n\cdot \sin\frac{n \pi x}{2 l}\cdot\cos\frac{n \pi c t}{2 l}$$

However there is one final initial condition that is piecewise, I'm unsure of how to apply this and the solutions expected are of a infinite series (fourier series).

The last initial condition is:

$$y(x,0)= \begin{cases} R\cdot\frac{x}{l} & \quad 0\le x\le 1 \\ R\cdot\left(2 - \frac{x}{l}\right) & \quad l\le x\le 2 l \end{cases}$$

Any help or advice on solving is much appreciated.

-
Please, check if I add correct LaTeX for your formula. – m0nhawk Nov 29 '12 at 17:56
I'm going to assume that because there is an $n$ in $y(x,t)$ it isn't just some single fixed $n$ and you should actually sum over them all...also should there really be a $ct$ in the $\sin$ part? I think it should just be $x$. – Matt Nov 29 '12 at 18:14
The $x$ was erroneously replaced by $ct$ by an earlier formatting edit. @Sam, you can avoid these sorts of problems by formatting the post yourself. We have a basic tutorial and quick reference for that. – joriki Nov 29 '12 at 18:28

Assuming all of our changes are correct, you can get all the $C_n$ by using the formula of the Fourier sine series coefficients:

The solution tells you that $y(x,0)=\sum_{n=1}^\infty C_n\sin\left(\frac{n\pi x}{2l}\right)$, and the condition tells you that this series must equal that piecewise function.

Thus $$C_n=\frac{1}{l}\int_0^{2l}y(x,0)\sin\left(\frac{n\pi x}{2l}\right)dx.$$

Since the function is given piecewise you have to break it up into two integrals:

$$C_n=\frac{1}{l}\int_0^l R\cdot\frac{x}{l}\sin\left(\frac{n\pi x}{2l}\right)dx+\frac{1}{l}\int_l^{2l}R\left(2-\frac{x}{l}\right)\sin\left(\frac{n\pi x}{2l}\right)dx$$

It is kind of tedious to make sure you don't lose any of these constants while integrating, but you should be able to solve it from here (look up $\int x\sin(ax)dx$ in a table to make it go quicker if you want).

-