Help Solving Textbook Heat Conduction Laplace Transforms PDE Problem

I am trying to solve the following problem:

$$\dfrac{\partial{\phi}}{\partial{t}} = \dfrac{\partial^2{\phi}}{\partial{x}^2} - \cos(x), \ x > 0, t > 0$$

$$\phi(x, 0) = 0, \ x > 0$$

$$\phi(0, t) = e^{-t}, \ t > 0$$

Taking the Laplace transform (in $t$, of course) gives

$$\mathcal{L} \left\{ \dfrac{\partial{\phi}}{\partial{t}} \right\} = \mathcal{L} \left\{ \dfrac{\partial^2{\phi}}{\partial{x}^2} - \cos(x) \right\}$$

$$\therefore s \mathcal{L}\{\phi\} - \phi(0) = \dfrac{d^2 \mathcal{L} \{ \phi \}}{dx^2} - \dfrac{\cos(x)}{s}$$

And since $\phi(x, 0) = 0$, we have

$$s \mathcal{L} \{ \phi \} = \dfrac{d^2 \mathcal{L} \{ \phi \}}{dx^2} - \dfrac{\cos(x)}{s}$$

This is an ODE with constant coefficients.

From now on, let $\mathcal{L}\{ \phi \} = \bar{\phi}$ (for the sake of conciseness).

So our constant-coefficient ODE is

$$\dfrac{d^2 \bar{\phi}}{dx^2} - s \bar{\phi} = \dfrac{\cos(x)}{s}$$

This is a inhomogeneous ODE and, judging by the inhomogeneous term $\dfrac{\cos(x)}{s}$, can be solved using the method of undetermined coefficients.

The homogeneous version of the ODE is

$$\dfrac{d^2 \bar{\phi}}{dx^2} - s \bar{\phi} = 0$$

The characteristic polynomial is

$$m^2 - s = 0$$

$$\therefore m = \pm \sqrt{s}$$

Therefore, the complementary equation for this inhomogeneous ODE is

$$y_c(x) = Ae^{x\sqrt{s}} + Be^{-x\sqrt{s}}$$

And our particular solution for this inhomogeneous ODE is

$$y_p(x) = -\dfrac{1}{s^2 - s} \cos(x)$$

Therefore, our solution to the inhomogeneous ODE is

$$y(x) = Ae^{x\sqrt{s}} + Be^{-x\sqrt{s}} - \dfrac{1}{s^2 - s} \cos(x)$$

Therefore, we have that

$$\bar{\phi}(x, s) = Ae^{x\sqrt{s}} + Be^{-x\sqrt{s}} - \dfrac{1}{s^2 - s} \cos(x)$$

Here is where I am stumped.

HOWEVER, one way that I have seen other problems proceed is by assuming another boundary condition:

$$\lim\limits_{x \to \infty} \phi(x, t) = 0$$

This makes sense from a physical standpoint, but it was not specified in the problem statement, so I am unsure if it is valid for me to use it?

Also, I don't have full solutions for these problems, so I have no way of checking the intermediate steps.

The final solution should be

$$\phi(x, t) = \text{erfc}\left( \dfrac{x}{2\sqrt{t}} \right) - \cos(1 - e^{-t})$$

I would greatly appreciate it if people could please help me solve this problem.

EDIT: If we proceed with assuming the extra boundary condition (that is, if we proceed with assuming that $\lim\limits_{x \to \infty} \phi(x, t) = 0$), then we continue from above as follows:

Now, since $\lim\limits_{x \to \infty} \phi(x, t) = 0$, we have that $Ae^{-x \sqrt{s}} = \dfrac{A}{e^{x \sqrt{s}}} \to 0$ as $x \to \infty$, and $- \dfrac{1}{s^2 - s} \cos(x)$ does not exist as $x \to \infty$, since $\cos(x)$ will not converge.

So what do we do from here? It seems that the $- \dfrac{1}{s^2 - s} \cos(x)$ term is causing us problems?

IGNORE EVERYTHING BELOW THIS POINT

$$\bar{\phi}(x, s) = \int_0^\infty \phi(x, t) e^{-st} \ dt,$$

we have that $\bar{\phi}(x, s) \to 0$ as $x \to \infty$, and hence $B = 0$, since $Ae^{-x \sqrt{s}} = \dfrac{A}{e^{x \sqrt{s}}} \to 0$ as $x \to \infty$.

Therefore, we now have

$$\bar{\phi}(x, s) = Ae^{-x \sqrt{s}}.$$

We now use the given boundary conditions.

Letting $x = 0$ in the Laplace transform of $\phi$ gives

$$\bar{\phi}(0, s) = \int_0^\infty \phi(0, t)e^{-st} \ dt = \int_0^\infty e^{-t}e^{-st} \ dt = \int_0^\infty e^{-t(1 + s)} \ dt$$

$$= \dfrac{-1}{1 + s} \int_0^{-\infty} e^u \ du = \dfrac{1}{1 + s},$$

since $\phi(0, t) = e^{-t}$ for all $t > 0$.

• @Ian Do you mean something is inconsistent with my work or the problem itself? Also, what do you mean by $\phi(x,0)=\lim_{s \to 0} s \overline{\phi}(x,s)$? I do not understand where this comes from. – The Pointer Aug 28 '18 at 14:38
• Sorry, disregard, I made a silly mistake. – Ian Aug 28 '18 at 14:40
• @Ian Oh, ok. So does my work seem correct? I wonder if it's the problem itself that is inconsistent? – The Pointer Aug 28 '18 at 14:41
• $y_p$ should be $y_p = \frac{1}{s(s+1)}\cos(x)$ because $\cos'' = -\cos$ – DisintegratingByParts Aug 29 '18 at 10:45
• @DisintegratingByParts Are you sure? I had it as that, and then was told that it should be $- \frac{1}{s(1+s)}$. See Dylan's answer in math.stackexchange.com/questions/2896937/… – The Pointer Aug 29 '18 at 16:08

Let $\widetilde{\phi}(x,s) = \int_{0}^{\infty}e^{-ts}\phi(x,t)dt$ be the Laplace transform of $\phi(x,t)$. As you said we have the following ODE for $\widetilde{\phi}(x,s)$: $$\dfrac{\partial^2{\widetilde{\phi}(x,s)}}{\partial{x}^2} -s\widetilde{\phi}(x,s)- \frac{\cos(x)}{s} = 0$$ The general solution is simply: $$\widetilde{\phi}(x,s)=Ae^{\sqrt{s}x}+Be^{-\sqrt{s}x} -\frac{\cos(x)}{s(s+1)}$$ where $A$ and $B$ are two arbitrary constant that need two condition to be determined. The first condition is a physical one: the solution must be limited in time and so $A=0$. The second condition is that: $$\phi(0, t) = e^{-t}, \ t > 0 .$$ Now the Laplace transform of $\phi(0,t)$ is simply $\widetilde{\phi}(0,s)=\frac{1}{1+s}$ and so we have $B = \frac{1}{s}$. Finally we have that the Laplace transform of our $\phi(x,s)$ is: $$\widetilde{\phi}(x,s)=\frac{e^{-\sqrt{s}x}}{s} - \frac{\cos(x)}{s(s+1)}$$

Now we have to transforming back. I don't know if you know complex analysis. If not, simply check a Laplace transform's table and see that the inverse Laplace transform of $\frac{e^{-\sqrt{s}x}}{s}$ is $\text{erfc}(\frac{x}{2\sqrt{t}})$ and the inverse L.T. of $\frac{1}{s(s+1)}$ is $1 - e^{-t}$ and so the solution is: $$\phi(x,t) = \text{erfc}\left( \dfrac{x}{2\sqrt{t}} \right) - \cos(x)(1 - e^{-t}).$$ If you know complex analysis you have to perform the following complex integral: $$\phi(x,t) = \frac{1}{2{\pi}i}\int_Ldze^{zt}\widetilde{\phi}(x,z)$$ where L is a vertical line in the complex plane on the right of all singularity of $\widetilde{\phi}(x,z)$. Be careful due to the presence of the square root: is a multivalued function.

Let $\Phi(s,x)=\int_{0}^{\infty}\phi(t,x)e^{-st}dt$ be the Laplace transform in time of the desired solution. Then the transform of the heat equation is $$\int_{0}^{\infty}e^{-st}\frac{\partial\phi}{\partial t}dt =\int_{0}^{\infty}e^{-st}\frac{\partial^2\phi}{\partial x^2}dt-\cos(x)\int_{0}^{\infty}e^{-st}dt.$$ Expanding this out gives $$e^{-st}\phi(t,x)|_{t=0}^{\infty}-\int_{0}^{\infty}(-se^{-st})\phi(t,x)dt \\ =\frac{\partial^2}{\partial x^2}\int_{0}^{\infty}e^{-st}\phi(t,x)dt-\left.\cos(x)\frac{e^{-st}}{-s}\right|_{t=0}^{\infty}.$$

Therefore, $$-\phi(0,x)+s\int_{0}^{\infty}e^{-st}\phi(t,x)dt=\frac{\partial^2}{\partial x^2}\int_{0}^{\infty}e^{-st}\phi(t,x)dt-\frac{\cos(x)}{s}.$$

Let $\Phi(s,x)=\int_{0}^{\infty}e^{-st}\phi(t,x)dt$. Then $\phi(0,x)=0$ gives

$$s\Phi(s,x)=\Phi_{xx}(s,x)-\frac{\cos(x)}{s} \\ \Phi_{xx}-s\Phi=\frac{\cos(x)}{s}.$$ A particular solution is $C\cos(x)$. But $\cos''=-\cos$, which gives $C(-1-s)=1/s$ or $C=-1/(s(1+s))$. So the general solution is

$$\Phi(s,x)=A\cos(\sqrt{s}x)+B\sin(\sqrt{s}x)-\frac{\cos(x)}{s(1+s)}.$$ Now you have to transform back in $s$.