Solve the heat equation using a transform method I need to solve $k\frac{\partial^2U}{\partial x^2}=\frac{\partial U}{\partial t}$ subject to
\begin{equation}
U(0,t)=1, t>0 \\ U(x,0)=e^{-x},x>0
\end{equation}
I tried using the Laplace transform with respect to $t$ since the function is defined for $t>0$ and we have the initial condition $U(x,0)=e^{-x}, x>0$. My problem is that I'm left with the complicated function:
\begin{equation}
c_{1}\cos\left(\sqrt{\frac{s}{k}}x\right) +c_{2}\sin\left(\sqrt{\frac{s}{k}}x\right)+ \frac{k}{s-k}e^{-x}
\end{equation}
which I don't know how to invert. I was wondering if there's any other way to approach this problem (can you apply some other transform? Is there anything I'm not seeing?). I need some guidance urgently since I'm preparing for a final exam. Thank you so much for your help!
 A: Too long for a comment.
Applying the Laplace transform we obtain
$$
sU(x,s)=k U_{xx}(x,s) + e^{-x},\ \ U(0,s)=1/s
$$
and after solving for $x$ we obtain
$$
U(x,s) = 2 C_0(s) \sinh \left(\frac{\sqrt{s} x}{\sqrt{k}}\right)+\frac{k e^{-\frac{\sqrt{s} x}{\sqrt{k}}}-s e^{-x}}{s(k-s)}
$$
here $C_0(s)$ appears due to the fact of incomplete boundary conditions. The problem needs one more condition.
A: Your solution is not quite correct. If we were to take the Laplace Transform of this expression, assuming $\mathcal{L}(U(x,t))(x,s)=V(x,s)$, we have
$$
k\frac{\partial^2 V}{\partial x^2}=sV-U(x,0)=sV-e^{-x}
$$
From here we can solve for $V$ in terms of constants that may depend on $s$. The homogeneous solution is
$$
V_h(x,s)=C_1(s)e^{x\sqrt{s/k}}+C_2(s)e^{-x\sqrt{s/k}}
$$
The particular solution must take the form of $A(s)e^{-x}$, so
$$kA(s)e^{-x}=sA(s)e^{-x}-e^{-x}\implies A(s)=\frac{1}{s-k}$$
Thus, the general solution is
$$V(x,s)=V_h(x,s)=C_1(s)e^{x\sqrt{s/k}}+C_2(s)e^{-x\sqrt{s/k}}+\frac{e^{-x}}{s-k}$$
We have to employ an assumption that for any fixed value of $t$, $U(x,t)\to 0$ as $x$ gets large, meaning that the total heat density falls to zero. This translates to the fact that as $x$ gets large, $V(x,s)$ should remain bounded (vague issues regarding convergence here), and so any growth in $x$ should be ignored. As such, we can assume that $C_1(s)=0$.
Next, using the boundary condition, we transform $U$ to get $V(0,s)=1/s$. Thus,
$$
C_2(s)+\frac{1}{s-k}=\frac{1}{s}\implies C_2(s)=-\frac{k}{s(s-k)}
$$
and so
$$
V(x,s)=\left(\frac{1}{s}-\frac{1}{s-k}\right)e^{-x\sqrt{s/k}}+\frac{e^{-x}}{s-k}
$$
From here, we need to leverage the well-known and famous Laplace Transform of
$$
\mathcal{L}\left\{\frac{1}{2\sqrt{\pi}t^{3/2}}e^{-\frac{1}{4t}}\right\}=e^{-\sqrt{s}}
$$
(this can be shown with a variety of clever calculus tricks) The modification to get our version with $x\sqrt{s/k}$ is to include a parameter in the exponent and we can show (through $u$-substitutions) that
$$
\mathcal{L}\left\{\frac{x}{2\sqrt{k\pi}t^{3/2}}e^{-\frac{x^2}{4kt}}\right\}=e^{-x\sqrt{s/k}}
$$
Now we can throw everything together using the convolution theorem. Thus,
$$
U(x,t)=\int_0^t\left(1-e^{k(t-u)}\right)\frac{x}{2\sqrt{k\pi}u^{3/2}}e^{-\frac{x^2}{4ku}}\,du+e^{kt-x}
$$
or a little more cleanly:
$$
\boxed{
U(x,t)=\frac{x}{2\sqrt{k\pi}}\int_0^t\frac{1}{u^{3/2}}\left(1-e^{k(t-u)}\right)e^{-\frac{x^2}{4ku}}\,du+e^{kt-x}
}
$$
From here, the integration is nasty, but doable, albeit in terms of non-elementary functions.
