# Question

The temperature profile $\theta(x, t)$ in a semi-infinite rod obeys the heat diffusion equation

$$\frac{\partial }{\partial t} \theta(x, t) = \frac{\partial^2}{\partial x^2} \theta(x, t)$$

With initial temperature distribution $\theta(x) = T_0$

At $t=0$, the temperature at the left end of the rod is changed instantaneously to $\theta(0, t) = 0$ and kept at this temperature for all $t > 0$. Use the Laplace transform method with respect to $t$ to find the solution to the differential equation.

# Working

The laplace of the left hand side :

\begin{equation} \begin{aligned} L\left( \frac{\partial }{\partial t} \theta(x, t) \right) &= s \Theta(x, s) - \theta(x, 0) \\ &= s \Theta(x, s) - T_0 \end{aligned} \end{equation}

And of the right hand side :

\begin{equation} \begin{aligned} L\left( \frac{\partial^2}{\partial x^2} \theta(x, t) \right) = \frac{\partial^2}{\partial x^2} \Theta(x, s) \end{aligned} \end{equation}

Which gives

\begin{equation} \begin{aligned} s \Theta(x, s) - T_0 &= \frac{\partial^2}{\partial x^2} \Theta(x, s) \\ \frac{\partial^2}{\partial x^2} \Theta(x, s) - s \Theta(x, s) &= T_0 \\ \frac{\partial^2 \Theta}{\partial x^2} - s \Theta &= T_0 \end{aligned} \end{equation}

I'm a bit unsure how to proceed from here though, in terms of what I can do to solve this.

What I'm considering is

\begin{equation} \begin{aligned} \Theta'' - s\Theta = T_0 \end{aligned} \end{equation}

Then this has the particular integral of

\begin{equation} \begin{aligned} \Theta'' - s\Theta = 0 \end{aligned} \end{equation}

With auxiliary equation

\begin{equation} \begin{aligned} m^2 - s & = 0 \\ m &= \pm \sqrt{s} \end{aligned} \end{equation}

And from here this is solved by considering cases for $s$ , those being $s<0,s=0,s>0$.

For $s<0$, $m$ is imaginary and the solution for $\Theta$ is

\begin{equation} \begin{aligned} \Theta &= c_1 \cos(\sqrt{s}x) + c_2 \sin(\sqrt{s}x) \end{aligned} \end{equation}

But this must be wrong as I've not considered any separation of variables.

I'm unsure how to proceed, and whether what I've done is valid.

# Posts I've viewed

Solving Heat Equation with Laplace Transform, I didn't really follow some of the notation here, such as:

I am setting $\mathcal{L}_t(u(x,t)) = U(x,s)|_s$

$\mathcal{L}(u'')=\mathcal{L}(\dot u) \rightarrow U''(x,s)=\frac s 4U(x,s)-\frac 14u(x,0)$

Problem with Heat Equation and Laplace Transform, this is more relating to Fourier transforms it seems. I couldn't follow it and apply it to my confusion here at least.

You're on the right track. What you should have now is $\Theta_{xx} - s\Theta = -T_0$ (note: you have a sign error). For each fixed $s$ this is a constant-coefficient second-order linear ODE in $x$. The general solution is given by the sum of the general solution to the homogeneous equation and any particular solution to the inhomogeneous equation. There shouldn't be a need to consider $s < 0$, as the Laplace variable is usually assumed $>0$ by definition. So for $s>0$ the solution to the homogeneous equation is given as a sum of exponentials $c_1e^{\sqrt{s}x} + c_2e^{-\sqrt{s}x}$ and by inspection $\Theta_p(x) = \frac{T_0}{s}$ is a solution to the inhomogeneous equation. You can use the initial-value theorem for the Laplace transform ($f(0^+) = \lim_{s\to\infty} sF(s)$) to show that $c_1 = 0$. The boundary condition $\theta(0,t) = 0$ implies $\Theta(0,s) = 0$ for all $s>0$, which then implies $c_2 = -\frac{T_0}{s}$. Altogether from here we obtain the Laplace transform $$\Theta(x,s) = -T_0\frac{e^{-\sqrt{s}x}}{s} + \frac{T_0}{s}.$$ We then invert this Laplace transform. The second term just gives a unit step function, and while the inverse Laplace transform of the first term can't be expressed in terms of elementary functions, we can express it using the rule $$F(s)/s = \mathcal{L}\left[\int_0^t f(\tau)~d\tau\right](s)$$ which gives $$\theta(x,t) = -T_0\int_0^t \mathcal{L}^{-1}[e^{-\sqrt{s}x}](\tau)~d\tau + T_0u(t),$$ where $u(t)$ is the unit step function. The inverse Laplace transform in the integral is a bit messy: Wolfram gives $$\mathcal{L}^{-1}[e^{-\sqrt{s}x}](\tau) = \frac{xe^{-\frac{x^2}{4\tau}}}{2\sqrt{\pi}\tau^{3/2}}.$$ Making the change of variables $\eta = x/2\sqrt{\tau}$, or equivalently $\tau = x^2/4\eta^2$, $d\tau = -\frac{x^2}{2\eta^3}d\eta$ gives $$\int_0^t \mathcal{L}^{-1}[e^{-\sqrt{s}x}](\tau)~d\tau = \frac{2}{\sqrt{\pi}}\int_{x/2\sqrt{t}}^\infty e^{-\eta^2} ~d\eta = \operatorname{erfc}(x/2\sqrt{t}),$$ where $\operatorname{erfc}$ denotes the complementary error function. Therefore the solution comes out to $$\theta(x,t) = -T_0\operatorname{erfc}(x/2\sqrt{t}) + T_0u(t).$$ To check that this is consistent with the initial and boundary conditions: at $t=0$, $\operatorname{erfc}(x/\sqrt{t}) = 0$ for all $x>0$, so $\theta(x,0) = T_0$ for all $x>0$, while at $x=0$ one can explicitly calculate the value of $\operatorname{erfc}(0)$ (it is half of the famous Gaussian integral) to find that $\theta(0,t) = -T_0 + T_0 = 0$.