Solve the 1D Heat Equation on $x \in [a,b]$
$$ \frac{\partial ^2 T}{\partial x^2} = \frac{1}{\alpha} \frac{\partial T}{\partial t}$$ $$ T(a,t) = T(b,t) = 0, T(x,0) = T_0(x) $$
Now, I know that we should actually just be able to consider the solution for $T(x-a,t)$, basically making the problem the standard 1D heat equation with homogeneous boundaries on $[0,L]$ rather than $[a,b]$, but I was just playing around with the $[a,b]$ case, and arrived at something which I can't figure out what is wrong with it.
Separating Variables
Separating variables as $T(x,t)=X(x)\Gamma(t)$ gives the standard equations:
$$X''+ \lambda_n ^2 X = 0$$ $$\Gamma' + \alpha \lambda_n ^2 \Gamma = 0$$
Where I am using the "prime" notation loosely even though they represent derivatives with respect to two different variables.
Solving these of course gives:
$$ X(x) = C_1 \cos(\lambda_n x) + C_2 \sin( \lambda_n x) $$ $$ \Gamma(t) = C_3 e^{-\alpha \lambda_n ^2 t} $$
Possible Mistake
Here is where I feel I am making a mistake. I apply the boundary conditions getting:
$$ T(a,t)=X(a)\Gamma(t)=0 \Rightarrow X(a)=0 $$ Same thing for B getting $X(b) = 0$
Then applying the conditions to the solution:
$$0=C_1 \cos(\lambda_n a) + C_2 \sin( \lambda_n a) $$ $$0=C_1 \cos(\lambda_n b) + C_2 \sin( \lambda_n b) $$
If we solve for $ C_1 = - C_2 \tan(\lambda_n a) $, then we can plug back into the bottom equation and get:
$$ 0 = -C_2 \tan(\lambda_n a) \cos(\lambda_n b) + C_2 \sin(\lambda_n b) $$ Giving the eigenvalues after some manipulation and $C_2$ dividing out as: $$ \tan(\lambda_n a) = \tan(\lambda_n b) $$
Finally, with $C_2$ and $C_3$ being absorbed to a single constant $C_n$, ignoring the $\lambda_0=0$ trivial eigenvalue, and plugging in the above expression for $C_1$ in terms of $C_2$ into the general solution we have:
$$ T(x,t) = \sum_{n=1}^\infty C_n (\sin(\lambda_n x) - \tan(\lambda_n a)\cos(\lambda_n x)) e^{-\alpha \lambda_n^2 t} $$
Now here, I tried to use the solution to the $x$ equation to get the constant $C_n$ using orthogonality like one would normally do. The Sturm-Liouville problem has the standard inner product as well. The only thing that should be different is the bounds.
$$ <f,g> = \int_{a}^b f(x)g(x)dx $$
The orthogonal set of functions for the Sturm-Liouville problem should be $\sin(\lambda_n x) -\tan(\lambda_n a)\cos(\lambda_n x)$ right? Because I try carrying out the integral:
$$ \int_{a}^b (\sin(\lambda_n x) -\tan(\lambda_n a)\cos(\lambda_n x))(\sin(\lambda_m x) -\tan(\lambda_m a)\cos(\lambda_m x)) dx $$
But, this does not give me identically $0$ for $n \neq m$. I tried doing the integration out on paper (messy but doable), and nothing stuck out as making this $0$ for different eigenvalues. I even checked on Desmos by numerically calculating some eigenvalues for a given $a$ and $b$ and then numerically integrating. Even to three decimal places, the precision error cannot account for how far these values were from $0$. So my main question is, where is my mistake? Is it...
This actually is not a valid Sturm-Liouville problem in this form for some reason, thus the functions are not orthogonal?
I'm using the wrong functions for orthogonality, or I have made an algebra error somewhere?
The inner product is actually $0$ and I made a mistake in the calculation?
I can't see why this is not a valid Sturm-Liouville problem, so the functions should be orthogonal. And if it isn't why? Any help is greatly appreciated. Thank you!
It's not hard to see that the solutions of $X''(x)+\lambda X(x)=0$ subject to $X(a)=X(b)=0$ are $$ X_n(x)=\sin\left(\frac{x-a}{b-a}n\pi\right), n=1,2,3,\cdots. $$The corresponding values of $\lambda$ are $$ \lambda_n = \frac{n^2\pi^2}{(b-a)^2}, n=1,2,3,\cdots. $$ And the corresponding solutions $\Gamma$ are $$ \Gamma_n(t)=\exp\left(-\alpha\frac{n^2\pi^2}{(b-a)^2}t\right). $$ You have not simplified your solutons enough to make the orthogonality conditions easy to see.