Solving Heat Equation with Laplace Transform

I am trying an alternative method to separation of variables to the following equation

$$\begin{cases} u_{xx} = 4u_t, &0 < x < 2, t>0\\ u(0,t)=0, u(2,t)=0, &t>0\\ u(x,0)=2\sin(\pi x), &0 \le x \le 2 \end{cases}$$

What I am attempting is to use a Laplace transform with respect to $t$ and then solve the ODE and take the inverse transform.

I get an answer in the right form, but the coefficients are off. I should get $u(x,t) = 2e^{\frac {-\pi^2t} {16}}\sin(\frac\pi2x)$ but end up getting $u(x,t) = 2e^{4\pi^2t}\sin\left( \frac\pi2 x \right)$

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)$

$U''(x)-\frac s 4U(x)+\frac 12 \sin(\pi x)$

I assume $s>0$ because that is the only way I get my boundary conditions to work out.

$U_H(x) = A \cos\left( \frac{\sqrt{s}}2 x\right) + B \sin\left(\frac{\sqrt{s}}2 x\right)$

I used variation of parameters to get

$A(x) = \frac 2{\sqrt{s}}\int \sin \left(\frac{\sqrt{s}}2 x\right)\sin(\pi x)dx = -4\sqrt{s}\left(\frac {\sin\left(\left(\pi - \frac {\sqrt{s}}2\right)x\right)}{\pi^2 - \frac s 2} - \frac {\sin\left(\left(\pi + \frac {\sqrt{s}}2\right)x\right)}{\pi^2 + \frac s 2}\right) + C_1$

$B(x) = -\frac 2{\sqrt{s}}\int \cos\left(\frac{\sqrt{s}}2 x\right)\sin(\pi x)dx = -4\sqrt{s}\left(\frac {\cos\left(\left(\pi - \frac {\sqrt{s}}2\right)x\right)}{\pi^2 - \frac s 2} + \frac {\cos\left(\left(\pi + \frac {\sqrt{s}}2\right)x\right)}{\pi^2 + \frac s 2}\right) + C_2$

$U_P(x) = A(x) \cos\left(\frac{\sqrt{s}}2 x\right) + B(x) \sin\left(\frac{\sqrt{s}}2 x\right)$

I simplify to $U(x) = C_1 \cos\left(\frac{\sqrt{s}}2 x\right) + C_2 \sin\left(\frac{\sqrt{s}}2 x\right) + 2 \frac 1{s - 4\pi^2 }\sin(\pi x)$

I plug in the boundary conditions to get $C_1 = C_2 = 0$ but when I try to take the inverse Laplace I get the aforementioned wrong solution. Can someone see an error in my work?

• Well, to start with you are a factor of 16 out in the line $\mathcal{L}(u'')=\mathcal{L}(\dot u) \rightarrow U''(x,s)=\frac{s}{4}U(x,s)-\frac{1}{4}u(x,0)$, which should be $\mathcal{L}(u'')=\mathcal{L}(\dot u) \rightarrow U''(x,s)=4sU(x,s)-4u(x,0)$. Does that fix it entirely? – Siwel Sep 6 '15 at 16:15
• Ah, so simple, I was thinking of the differential in $t$, but was solving for the differential in $x$. If you put that as an answer I will accept. – kleineg Sep 8 '15 at 13:24

The only mistake I can see is that the factor of $4$ in $u_{xx} =4u_t$ has become a factor of $\frac 14$. So the line

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

$$\mathcal{L}(u'')=\mathcal{L}(\dot u) \rightarrow U''(x,s)=4sU(x,s)-4u(x,0).$$ Following through with this correction should give you the correct answer.

• Of course it is just a simple algebraic mistake. Haha. The hardest part of solving PDEs are the ODEs, the hardest part about ODEs is calculus, and the hardest part about calculus is algebra. – kleineg May 7 '18 at 14:00