# Fourier Series - Wave Eqn

• May 31st 2008, 03:41 PM
Chris L T521
Fourier Series - Wave Eqn
I just have a quick question:

I'm evaluating a Fourier coefficient for the following series:

$\displaystyle y(x,t)=\sum_{n=1}^{\infty}B_n\sin\left(\frac{n\pi a}{L}t\right)\sin\left(\frac{n\pi}{L}x\right)$

Where $\displaystyle B_n=\frac{2}{n\pi a}\int_0^L \psi(x)\sin\left(\frac{n\pi}{L}x\right)\,dx$ and $\displaystyle \psi \left( x \right) = \left\{ \begin{array}{cl} 0 &0 \leqslant x \leqslant \frac{{L - a}} {2} \\ 1 & \frac{{L - a}} {2} < x < \frac{{L + a}} {2} \\ 0 & \,\,\frac{{L + a}} {2} < x < L \\ \end{array} \right.$

I'm going to show my work:

I said that

\displaystyle \begin{aligned} B_n&=\frac{2}{n\pi a} \left[\int_0^{\frac{L-a}{2}}(0)\sin\left(\frac{n\pi}{L}x\right)\,dx+\int _{\frac{L-a}{2}}^{\frac{L+a}{2}}\sin\left(\frac{n\pi}{L}x\ri ght)\,dx+ \int_{\frac{L+a}{2}}^L(0)\sin\left(\frac{n\pi}{L}x \right)\,dx\right] \\ &=\frac{2}{n\pi a}\int_{\frac{L-a}{2}}^{\frac{L+a}{2}}\sin\left(\frac{n\pi}{L}x\ri ght)\,dx \end{aligned}

\displaystyle \begin{aligned} B_n&= \frac{2}{n\pi a}\left.\left[-\frac{L}{n\pi}\cos\left(\frac{n\pi}{L}x\right)\rig ht]\right|_{\frac{L-a}{2}}^{\frac{L+a}{2}} \\ &=\frac{-2L}{n^2\pi^2a}\left[\cos\left(\frac{n\pi}{L}\cdot\frac{L+a}{2}\right)-\cos\left(\frac{n\pi}{L}\cdot\frac{L-a}{2}\right)\right] \end{aligned}

This is what I did to simplify what was in the brackets:

$\displaystyle \cos\left(\frac{n\pi}{2}+\frac{n\pi a}{2L}\right)-\cos\left(\frac{n\pi}{2}-\frac{n\pi a}{2L}\right)$

$\displaystyle \implies \cos\frac{n\pi}{2}\cos\frac{n\pi a}{2L}-\sin\frac{n\pi}{2}\sin\frac{n\pi a}{2L}-\cos\frac{n\pi}{2}\cos\frac{n\pi a}{2L}-\sin\frac{n\pi}{2}\sin\frac{n\pi a}{2L}$

$\displaystyle \implies -2\sin\frac{n\pi}{2}\sin\frac{n\pi a}{2L}$

Multiplying by $\displaystyle -\frac{2L}{n^2\pi^2a}$, I get:

$\displaystyle \frac{4L}{n^2\pi^2a}\sin\frac{n\pi}{2}\sin\frac{n\ pi a}{2L}$

Now this is where I'm somewhat in the dark. Since I'm plugging in values of n, where $\displaystyle n\in \mathbb{N}$, into $\displaystyle \sin\frac{n\pi}{2}$, I notice when n is odd, I get either 1 or -1, and when n is even, I get zero. Thus, I rewrote my answer as:

$\displaystyle \frac{4L}{n^2\pi^2a}\sin\frac{(2n-1)\pi}{2}\sin\frac{n\pi a}{2L}$

I noticed that $\displaystyle \sin\frac{(2n-1)\pi}{2}$ could be written as $\displaystyle (-1)^{n+1}; \text{ } n\in\mathbb{N}$

So then I saw that $\displaystyle B_n=\frac{4(-1)^{n+1}L}{n^2\pi^2a}\sin\frac{n\pi a}{2L}$

Thus, my series solution would be

$\displaystyle y(x,t)=\frac{4L}{\pi^2a}\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^2}\sin\left(\frac{n\pi a}{2L}\right)\sin\left(\frac{n\pi a}{L}t\right)\sin\left(\frac{n\pi}{L}x\right)$

Is this correct??

However, my question is this: when I rewrote $\displaystyle \sin\frac{n\pi}{2}$ as $\displaystyle \sin\frac{(2n-1)\pi}{2}$, do I need to replace the other n's in my equation with 2n-1? meaning, would my answer for $\displaystyle B_n$ be $\displaystyle \frac{4L}{(2n-1)^2\pi^2a}\sin\frac{(2n-1)\pi}{2}\sin\frac{(2n-1)\pi a}{2L}$????

I'd appreciate any help.
• May 31st 2008, 05:22 PM
Reckoner
Quote:

Originally Posted by Chris L T521
However, my question is this: when I rewrote $\displaystyle \sin\frac{n\pi}{2}$ as $\displaystyle \sin\frac{(2n-1)\pi}{2}$, do I need to replace the other n's in my equation with 2n-1? meaning, would my answer for $\displaystyle B_n$ be $\displaystyle \frac{4L}{(2n-1)^2\pi^2a}\sin\frac{(2n-1)\pi}{2}\sin\frac{(2n-1)\pi a}{2L}$????

$\displaystyle B_n = \frac{4L}{n^2\pi^2a}\sin\frac{n\pi}{2}\sin\frac{n\ pi a}{2L}$
any time $\displaystyle n$ is even, this term evaluates to zero, as you observed. The only remaining terms will be those for which $\displaystyle n$ is odd. The values of $\displaystyle \frac{4L}{n^2\pi^2a}\text{ and }\sin\frac{n\pi a}{2L}$ do not matter for even $\displaystyle n$, because they're being multiplied by zero. However, with
$\displaystyle B_n = \frac{4L}{n^2\pi^2a}\sin\frac{(2n-1)\pi}{2}\sin\frac{n\pi a}{2L}$
this changes. Now, the values of $\displaystyle \frac{4L}{n^2\pi^2a}\text{ and }\sin\frac{n\pi a}{2L}$ will affect the result regardless of whether $\displaystyle n$ is even or odd.