I'm trying to find the time dependent solution to the heat equation in a very long cylinder (the problem only depends on radius, r, and time, t) with the initial value $T(r,0)=T_1$ and the Dirichlet conditions $T(R,t)=T_2$ and $T(0,t)=T_0$, where $R$ is the radius of the cylinder. The PDE is
$$\partial_tT-a\nabla^2T=0 \, .$$
I started to use the separation of variables method and correctly got the general solution
$$T(r,t)=\sum_{n=1}^\infty A_n J_0(k_nr)e^{-ak_n^2t}$$
where $J_0(k_nr)$ is a Bessel function.
I don't understand how to decide the coefficient $A_n$. My textbook says that I should first use the initial value, which in this case would remove the exponential term, leaving
$$T(r,0)=T_1-T_2=\sum_{n=1}^\infty A_nJ_0(k_nr) \, .$$
Now my book says I should multiply with the function inside the sum and change $n$ to an $m$ and then integrate, which would give me
$$\int_0^R J_0(k_mr)(T_1-T_2)dr=\sum A_n\int_0^R J_0(k_nr)J_0(k_mr)dr \, .$$
However the correct answer to this problem says that you should multiply with $J_0(k_mr)r$ instead of $J_0(k_mr)$ and then puts $m=n$.
My questions are therefore:
- Where does the extra $r$ come from?
- Why can you assume $m=n$?
I feel like I don't understand the theory behind finding these coefficients in series so I hope someone can explain the basics.