I am currently working on a partial differential heat equation. I have found the infinite sum form of the solution, however, I have spotted an issue with the expansion of the sum, and I am unsure how to proceed. Allow me to elaborate:
The heat flow problem is given: $$u_t = 4u_{xx}, t>0, 0<x<π,$$ $$u_x(0,t) = u_x(π,t) = 0, t>0$$ $$u(x,0) = 2 - cos(2x) + 5cos(3x), 0\le x \le π$$
Utilizing the formula for Fourier coefficients and solving the BVP, I have attained the solution: $$u(x,t) = \frac 2π\sum_{n=1}^{\infty}\left(\frac{2(1-(-1)^n)}{n}-\frac{n(1-(-1)^n)}{n^2-4}+\frac{5n(1+(-1)^n)}{n^2-9} \right)e^{-4n^2t}sin(nx)$$
There arises an issue when expanding this series, as when $n=2$ or $n=3$, the series coefficient expression becomes undefined, as dividing by either $2^2-4$ or $3^2-9$ results in a divide by zero error. My inclination is to expand the first term of the series (as the series is defined at $n=1$) and then bypass the $n=2$ and $n=3$ terms, indexing the series from $n=4$. However, I am worried that this is bad practice, and that I may be missing some fundamental understanding about the Fourier series and infinite sums.
Please advise and share your understanding. Additionally, I am happy to show my work if required. I greatly appreciate your time and aid!
Using the Laplace transform
$$ sU(x,s)=4U_{xx}(x,s)+2\cos(2x)+5\cos(3x),\ \ U_x(0,s)=U_x(\pi,s)=0 $$
Solving for $x$ we have
$$ U(x,s) = \frac{2}{s}-\frac{\cos (2 x)}{s+16}+\frac{5 \cos (3 x)}{s+36} $$
and after inversion
$$ u(x,t) = 2-e^{-16 t} \cos (2 x)+5 e^{-36 t} \cos (3 x) $$