Considering this problem
$$\frac{\partial^{2} T(x, t)}{\partial x^{2}}=\frac{1}{\alpha} \frac{\partial T(x, t)}{\partial t} \quad \text { in } \quad 0<x<\infty, \quad t>0$$
$$\begin{array}{ll} \mathrm{BC} 1: & T(x=0)=f(\tau)=\sin(\omega \tau) \\ \mathrm{BC} 2: & T(x \rightarrow \infty)=0 \\ \mathrm{IC}: & T(x, t=0)=0 \end{array}$$
The solution is given by $$T(x, t)=\frac{x}{\sqrt{4 \pi \alpha}} \int_{\tau=0}^{t} \frac{\sin(\omega\tau)}{(t-\tau)^{3 / 2}} \exp \left[\frac{-x^{2}}{4 \alpha(t-\tau)}\right] d \tau$$
However I have another solution which is given by a much compact and easy form
$$T(x, t)= e^{-x / d}[\sin (\omega t-x / d)]$$
$$d=(2 \alpha / \omega)^{\frac{1}{2}}$$
assuming initial condition is $T(x, t=0)=e^{-x/d}\sin(-x/d)$.
Then when $t\rightarrow \infty$ this two solutions will converge.
My question is what's the relationship between the two equations. How to obtain the latter solution?
Let's consider the derivation of the solution. First, introduce the Laplace transform, $$ U(x,s) = \int_{0}^{\infty}\mathrm{d}t ~ \mathrm{e}^{-st}~T(x,t). $$ Using this, the 1D heat equation can rewritten as $$ \alpha\frac{\partial^2 U}{\partial x^2} = sU(x,s) - T(x,0). $$ For your first problem, because $T(x,0) = 0$, you can solve this equation as $$ U(x,s) = A\mathrm{e}^{-x\sqrt{s/\alpha}}, $$ where $A$ is a constant determined by BC. Perform the inverse Laplace transform, and you can obtain the solution.
However, in your second problem, since $T(x,0)$ is nonzero, you can not obtain $U$. So, let's assume $$ T = \mathrm{Re}[g(x)\mathrm{e}^{-i\omega t}], $$ where $g(x)$ is a complex–valued function. Therefore, the heat equation becomes \begin{align} g''(x) - \frac{i\omega}{\alpha}g(x) &= 0 \\ g(0) &= i \\ g(x \to \infty) &= 0. \end{align} Solve these equations, and you can obtain the solution.