Homogeneous Linear ODEs with Constant Coefficients
As I was finalizing my study of the method of separation of variables, I ran into the inconsistency that I had forgotten how to solve homogeneous linear ODEs with constant coefficients, that is, equations of the form$$a\frac{d^2y}{dx^2}+b\frac{dy}{dx}+cy=0$$Basically, we perform the following lambda substitution:$$a\lambda^2+b\lambda+c=0$$and solve the resulting quadratic equation for $\lambda$:$$\lambda=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$There are three cases:
- If $b^2-4ac>0$, then we have a solution of the form$$y=c_1e^{\lambda_1x}+c_2e^{\lambda_2x}$$
- If $b^2-4ac=0$, then we have a solution of the form$$y=c_1e^{\lambda x}+c_2xe^{\lambda x}$$
- If $b^2-4ac<0$, then we have a solution of the form$$y=e^{\alpha x}(c_1\cos\beta x+c_2\sin\beta x)$$
The last one is derived from Euler's formula $e^{i\theta}=\cos\theta+i\sin\theta$, and the solution is taken to have the form $\lambda=\alpha\pm i\beta$.
Example$$y''+3y'+2y=6$$To find the complementary function $y_c$, we perform a lambda substitution and solve:$$\lambda^2+3\lambda+2=0\\\lambda=-2\text{ or }-1\\y_c=c_1e^{-x}+c_2e^{-2x}$$The particular solution has the form $y_p=A$. Differentiating and substituting accordingly gives$$2A=6\Longrightarrow A=3$$Therefore, by the superposition principle, the general solution to the ODE is$$y=y_c+y_p=c_1e^{-x}+c_2e^{-2x}+3$$
The Method of Separation of Variables
We want to solve the PDE$$\frac{\partial u}{\partial t}=k\frac{\partial^2u}{\partial x^2}$$with initial and boundary conditions$$u(x,0)=f(x)\\u(0,t)=0\\u(L,t)=0$$To do that, let's assume the solution has the form$$u(x,t)=\varphi(x)G(t)$$Don't ask, just accept it. There's a reason behind picking such form, but it wouldn't help to explain it now. With that said, let's plug this solution into our PDE to obtain$$\varphi(x)\frac{dG}{dt}=kG(t)\frac{d^2\varphi}{dx^2}$$Now, let's separate variables!$$\frac{1}{kG(t)}\frac{dG}{dt}=\frac{1}{\varphi(x)}\frac{d^2\varphi}{dx^2}$$If you look at what we just obtained, you're eventually going to ask yourself: "how's it possible for a function in terms of $t$ to be equal to a function in terms of $x$? This makes no sense at all!" Well, of course it doesn't, unless they're both equal to the same constant! Let's call this constant $\lambda$:$$\frac{1}{kG(t)}\frac{dG}{dt}=\frac{1}{\varphi(x)}\frac{d^2\varphi}{dx^2}=-\lambda$$Again, the reason we separated our equation this way and the reason we put a negative sign before $\lambda$ are for the purpose of convenience only. It'll all make sense down the road, so stop scratching your head and keep reading! By the way, notice that our partial derivatives turned into normal ones because we're dealing with functions with one variable.
Now, let's solve the first ODE$$\frac{dG}{dt}=-\lambda kG(t)$$Our famous toolkit methods lead to the solution$$G(t)=ce^{-\lambda kt}$$With that out of the way, we can now solve the second ODE (it's a BVP)$$\frac{d^2\varphi}{dx^2}=-\lambda\varphi\\\varphi(0)=0\\\varphi(L)=0$$Performing a lambda substitution would be confusing, so let's call it an $m$ substitution. It'll yield$$m=\pm\sqrt{-\lambda}$$Again we have three cases:
Now, let's solve the first ODE$$\frac{dG}{dt}=-\lambda kG(t)$$Our famous toolkit methods lead to the solution$$G(t)=ce^{-\lambda kt}$$With that out of the way, we can now solve the second ODE (it's a BVP)$$\frac{d^2\varphi}{dx^2}=-\lambda\varphi\\\varphi(0)=0\\\varphi(L)=0$$Performing a lambda substitution would be confusing, so let's call it an $m$ substitution. It'll yield$$m=\pm\sqrt{-\lambda}$$Again we have three cases:
- If $\lambda>0$, then$$\varphi=c_1\cos\sqrt\lambda x+c_2\sin\sqrt\lambda x$$From the boundary conditions,$$\varphi(0)=0\Longrightarrow c_1=0\\\varphi(L)=0\Longrightarrow c_2\sin\sqrt{\lambda}L=0$$To avoid the trivial solution, we must have that$$\sin\sqrt\lambda L=0\Longrightarrow\lambda=\left(\frac{n\pi}{L}\right)^2$$where $n\in\mathbb{N}$. As a result, we're left with$$\varphi(x)=c_2\sin\frac{n\pi x}{L}$$
- If $\lambda=0$, then$$\varphi=c_1+c_2x$$From the boundary conditions,$$\varphi(0)=0\Longrightarrow c_1=0\\\varphi(L)=0\Longrightarrow c_2=0$$Therefore, $\lambda=0$ is not an eigenvalue for this problem.
- If $\lambda<0$, then$$\varphi=c_1e^{\sqrt sx}+c_2e^{-\sqrt sx}$$where $\lambda=-s$. Let's use the hyperbolic functions to represent this$$\varphi=c_3\cosh\sqrt sx+c_4\sinh\sqrt sx$$From the boundary conditions,$$\varphi(0)=0\Longrightarrow c_3=0\\\varphi(L)=0\Longrightarrow c_4\sinh\sqrt sL=0\Longrightarrow c_4=0$$because $\sqrt sL>0$ and $\sinh$ is never zero for a positive argument. Therefore, $\lambda<0$ is not an eigenvalue for this problem, either.
In summary, we obtained product solutions of the heat equation$$u(x,t)=B\sin\frac{n\pi x}{L}e^{-k(n\pi/L)^2t}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,n=1,2,3,\dots$$Finally, by the principle of superposition, we claim that the following infinite series is the solution of our heat conduction problem:$$u(x,t)=\sum_{n=1}^{\infty}B_n\sin\frac{n\pi x}{L}e^{-k(n\pi/L)^2t}$$Phew! I guess I could now do the same thing for the multidimensional case, lol.