# Thread: Fourier Series - Wave Eqn

1. ## Fourier Series - Wave Eqn

I just have a quick question:

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

$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 $B_n=\frac{2}{n\pi a}\int_0^L \psi(x)\sin\left(\frac{n\pi}{L}x\right)\,dx$ and $\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

\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}

\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:

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

$\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}$

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

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

$\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 $n\in \mathbb{N}$, into $\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:

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

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

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

Thus, my series solution would be

$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 $\sin\frac{n\pi}{2}$ as $\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 $B_n$ be $\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.

2. Originally Posted by Chris L T521
However, my question is this: when I rewrote $\sin\frac{n\pi}{2}$ as $\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 $B_n$ be $\frac{4L}{(2n-1)^2\pi^2a}\sin\frac{(2n-1)\pi}{2}\sin\frac{(2n-1)\pi a}{2L}$????
$B_n = \frac{4L}{n^2\pi^2a}\sin\frac{n\pi}{2}\sin\frac{n\ pi a}{2L}$
any time $n$ is even, this term evaluates to zero, as you observed. The only remaining terms will be those for which $n$ is odd. The values of $\frac{4L}{n^2\pi^2a}\text{ and }\sin\frac{n\pi a}{2L}$ do not matter for even $n$, because they're being multiplied by zero. However, with
$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 $\frac{4L}{n^2\pi^2a}\text{ and }\sin\frac{n\pi a}{2L}$ will affect the result regardless of whether $n$ is even or odd.