# Diffusion PDE with periodic boundary conditions I proceeded with using separation of variables:

$$\frac{T'(t)}{kT(t)}=\frac{X''(x)}{X(x)}=-λ$$

Assuming $λ=β^2>0$, I end up with:

$$X''(x)+λX(x)=0$$ and its general solution:

$$X(x)=A_n\cos(\beta x)+B_n\sin(\beta x)$$

Now, the periodic boundary conditions come to play:

$$X(L)=X(-L)$$ $$A_n\cos(\beta L)+B_n\sin(\beta L)=A_n\cos(\beta L)-B_n\sin(\beta L)$$ $2B_n\sin(\beta L)=0$ so $\beta L=n\pi, n=1,2,\ldots$

$$λ=\left(\frac{n\pi}{L}\right)^2$$ which can be derived from the second condition as well.

My question has to do with (b):

Why do we have to separate $\dfrac{A_0}{2}$ from the rest of the infinite sum and what's the problem with $n$ being $0$?

When you solved the equation $\sin\beta L=0$, your solution should be $\beta=\frac{n\pi}L$ for $n=\dots,-2,-1,0,1,2,\ldots$. So the general solution is $$\sum_{-\infty}^\infty (\text{stuff})$$Now, since this $(\text{stuff})$ is symmetric in $n$, you can group the terms to get $$\sum_{n=-\infty}^\infty (\text{stuff}) = (\text{stuff at } n=0) + 2\sum_{n=1}^\infty (\text{stuff})$$You'll find that all that $\text{stuff}$ comes out to $A_0/2$ when it is evaluated at $n=0$, which is where that comes from.
• +1 for $\displaystyle\sum \text{(stuff)}$ notation :) – hypergeometric May 4 '18 at 19:26
• @AndrewTzevas you have to take the negative values into account because they still provide a solution and you are looking for a general solution. The $2$ isn't there because they appear to have divided the whole general solution by $2$. This is allowed since all the constants are arbitrary, and this is just a general solution. This division is also what causes the $\frac12$ in front of the $A_0$. – John Doe May 4 '18 at 20:04
There is no problem. This, first, emphasizes that eigenvalue $\lambda_0$ has only one eigenfunction, all other eigenvalues have two.
The division by 2 is a convention: if you wrote just $A_0$ then the formulas for $A_0$ and $A_n$ are different whereas having $A_0/2$ yields that we can write $$A_n=\frac{1}{l}\int_{-l}^{l} f(x)\cos \sqrt{\lambda_n} x\, dx,\quad n=0,1,2,\ldots$$