Partial Differential Equations – Solving the Heat Equation Using Separation of Variables

heat equationpartial differential equations

Solve the initial value problem:
$$\begin{cases}
u_t = ku_{xx} \ \ &\text{for} \ \ x > 0, t > 0,\\
u(x,0) = e^{-2x} \ \ &\text{for} \ \ x > 0,\\
u(0,t) = 0 \ \ &\text{for} \ \ t > 0\\
\end{cases}$$

Attempted solution – Using the separation of variables $$u(x,t) = X(x)T(t)$$ then $$u_t(x,t) = X(x)T'(t), \ \ u_x(x,t) = X'(x)T(t)$$ $$u_{xx}(x,t) = X^{\prime\prime}(x)T(t)$$ thus $$X(x)T'(t) = k X^{\prime\prime}T(t)$$ Rearranging algebraically we have $$\frac{X^{\prime\prime}}{X(x)} = \frac{T'(t)}{kT(t)} = -\lambda$$ Rearranging again we get $$T' + k\lambda T = 0 \ \ X^{\prime\prime} + \lambda X = 0$$
The general solution to the $T$-equation is of the form $$T(t) = e^{k\lambda t}$$
The general solution to the $X$-equation is of the form
$$X(x) = \begin{cases}
c_1\cos Bx + c_2 \sin Bx \ \ &\text{if} \ \ \lambda = B^2 > 0\\
c_1e^{\sqrt{\gamma} x} + c_2 e^{-\sqrt{\gamma} x} \ \ &\text{if} \ \ \lambda = -\gamma^2 < 0\\
c_1 + c_2 x \ \ &\text{if} \ \ \lambda = 0\\
\end{cases}$$
Since the given equation is a heat equation $u(x,t)$ should decrease with the increase of time thus we have $$X(x) = c_1 e^{\sqrt{\gamma}x} + c_2 e^{-\sqrt{\gamma}x} \ \ \text{and} \ \ T = c_3 e^{\lambda k t}$$

I am not sure how to apply the initial/boundary conditions to this problem any help would be greatly appreciated.

Best Answer

The separated equations are, as you wrote, $$ T'(t)=-k\lambda T(t),\\ X''(x)+\lambda X(x) = 0, \;\;X(0) = 0. $$ Boundedness in $t$ forces $\lambda > 0$, and gives $X$ solutions $$ X_{\lambda}(x) = \sin(\sqrt{\lambda}x),\;\;\; \lambda > 0. $$ A general solution is found by forming an integral "sum" of solutions $$ u(x,t)=\int_{0}^{\infty}c(\mu)e^{-k\mu^2 t}\sin(\mu x)d\mu $$ The coefficient function $c(\mu)$ is determined by the initial condition and the inverse Fourier sine transform: $$ e^{-2x}= u(x,0) = \int_{0}^{\infty}c(\mu)\sin(\mu x)d\mu \\ \implies \frac{2}{\pi}\int_{0}^{\infty}e^{-2y}\sin(\mu y)dy = c(\mu). $$ The integral can be explicitly carried out, and I'll leave that to you. The solution obtained using this method is $$ u(x,t) = \frac{2}{\pi}\int_{0}^{\infty}\left(\int_{0}^{\infty}e^{-2y}\sin(\mu y)dy\right)e^{-k\mu^2 t}\sin(\mu x)d\mu. $$

Related Question