TITLE: how to solve $ {\partial u \over \partial t} - k {\partial ^2 u \over \partial x^2} =0$
QUESTION [5 upvotes]: How do I solve the following PDE for it's general solution?
$$ {\partial u \over \partial t} - k {\partial ^2 u \over \partial x^2} =0$$
How do I determine the general the solution of this equation will be $u(x, t) = X(x)T(t) $? I tried Monge's method but couldn't get it. My textbook only deals with particular solution using boundary condition.

REPLY [3 votes]: Case $1$: $\text{Re}(kt)\geq0$
Let $u(x,t)=X(x)T(t)$ ,
Then $X(x)T'(t)-kX''(x)T(t)=0$
$X(x)T'(t)=kX''(x)T(t)$
$\dfrac{T'(t)}{kT(t)}=\dfrac{X''(x)}{X(x)}=-(f(s))^2$
$\begin{cases}\dfrac{T'(t)}{T(t)}=-k(f(s))^2\\X''(x)+(f(s))^2X(x)=0\end{cases}$
$\begin{cases}T(t)=c_3(s)e^{-kt(f(s))^2}\\X(x)=\begin{cases}c_1(s)\sin(xf(s))+c_2(s)\cos(xf(s))&\text{when}~f(s)\neq0\\c_1x+c_2&\text{when}~f(s)=0\end{cases}\end{cases}$
$\therefore u(x,t)=C_1x+C_2+\int_sC_3(s)e^{-kt(f(s))^2}\sin(xf(s))~ds+\int_sC_4(s)e^{-kt(f(s))^2}\cos(xf(s))~ds$ or $C_1x+C_2+\sum_sC_3(s)e^{-kt(f(s))^2}\sin(xf(s))+\sum_sC_4(s)e^{-kt(f(s))^2}\cos(xf(s))$
Case $2$: $\text{Re}(kt)\leq0$
Let $u(x,t)=X(x)T(t)$ ,
Then $X(x)T'(t)-kX''(x)T(t)=0$
$X(x)T'(t)=kX''(x)T(t)$
$\dfrac{T'(t)}{kT(t)}=\dfrac{X''(x)}{X(x)}=(f(s))^2$
$\begin{cases}\dfrac{T'(t)}{T(t)}=k(f(s))^2\\X''(x)-(f(s))^2X(x)=0\end{cases}$
$\begin{cases}T(t)=c_3(s)e^{kt(f(s))^2}\\X(x)=\begin{cases}c_1(s)\sinh(xf(s))+c_2(s)\cosh(xf(s))&\text{when}~f(s)\neq0\\c_1x+c_2&\text{when}~f(s)=0\end{cases}\end{cases}$
$\therefore u(x,t)=C_1x+C_2+\int_sC_3(s)e^{kt(f(s))^2}\sinh(xf(s))~ds+\int_sC_4(s)e^{kt(f(s))^2}\cosh(xf(s))~ds$ or $C_1x+C_2+\sum_sC_3(s)e^{kt(f(s))^2}\sinh(xf(s))+\sum_sC_4(s)e^{kt(f(s))^2}\cosh(xf(s))$
Hence $u(x,t)=\begin{cases}C_1x+C_2+\int_sC_3(s)e^{-kt(f(s))^2}\sin(xf(s))~ds+\int_sC_4(s)e^{-kt(f(s))^2}\cos(xf(s))~ds&\text{when}~\text{Re}(kt)\geq0\\C_1x+C_2+\int_sC_3(s)e^{kt(f(s))^2}\sinh(xf(s))~ds+\int_sC_4(s)e^{kt(f(s))^2}\cosh(xf(s))~ds&\text{when}~\text{Re}(kt)\leq0\end{cases}$ or $\begin{cases}C_1x+C_2+\sum_sC_3(s)e^{-kt(f(s))^2}\sin(xf(s))+\sum_sC_4(s)e^{-kt(f(s))^2}\cos(xf(s))&\text{when}~\text{Re}(kt)\geq0\\C_1x+C_2+\sum_sC_3(s)e^{kt(f(s))^2}\sinh(xf(s))+\sum_sC_4(s)e^{kt(f(s))^2}\cosh(xf(s))&\text{when}~\text{Re}(kt)\leq0\end{cases}$
This is already the general solution of $\dfrac{\partial u}{\partial t}-k\dfrac{\partial^2u}{\partial x^2}=0$ . Note that when without any I.C.s, the form of $f(s)$ can choose arbitrary, but when I.C.s are given, the form of $f(s)$ and the choice whether using the integration kernel or using the summation kernel should choose wisely in order to accommodate the I.C.s to get the most nice form of the solution, especially the number of I.C.s is more than two.
Another brilliant method is called the power series method.
Similar to PDE - solution with power series:
Let $u(x,t)=\sum\limits_{n=0}^\infty\dfrac{(x-a)^n}{n!}\dfrac{\partial^nu(a,t)}{\partial x^n}$ ,
Then $u(x,t)=\sum\limits_{n=0}^\infty\dfrac{(x-a)^{2n}}{(2n)!}\dfrac{\partial^{2n}u(a,t)}{\partial x^{2n}}+\sum\limits_{n=0}^\infty\dfrac{(x-a)^{2n+1}}{(2n+1)!}\dfrac{\partial^{2n+1}u(a,t)}{\partial x^{2n+1}}=\sum\limits_{n=0}^\infty\dfrac{(x-a)^{2n}}{k^n(2n)!}\dfrac{\partial^nu(a,t)}{\partial t^n}+\sum\limits_{n=0}^\infty\dfrac{(x-a)^{2n+1}}{k^n(2n+1)!}\dfrac{\partial^{n+1}(a,t)}{\partial t^n\partial x}=\sum\limits_{n=0}^\infty\dfrac{f^{(n)}(t)(x-a)^{2n}}{k^n(2n)!}+\sum\limits_{n=0}^\infty\dfrac{g^{(n)}(t)(x-a)^{2n+1}}{k^n(2n+1)!}$