I need to find an explicit solution $u(x,t)$ of the system
$$\begin{cases} \partial_x^2 u = \frac{1}{k} \partial_t u \\ u(x,0) = f(x) \end{cases}$$
where $f(x) = x^2e^{-x^2}$, $\,x \in \mathbb{R}, \,t>0$ and $k>0$ is fixed.
I know this should be done using Fourier transform but I'm not very sure how to proceed. Also, as for the "heat problem" I know that there is a general way to approach this kind of exercises, so I'm more interested at the general approach than at the solution of this problem.
We use variable separation methods to solve heat equations. Assume the solution has the following form
$$u(x,t) = X(x)T(t)$$
Now, we plug this into the heat equation
$$\partial_x^2u = \frac{1}{k}\partial_tu$$
$$T(t)X''(x) = \frac{1}{k}X(x)T'(t)$$
Dividing by $X(x)T(t)$ on both sides
$$\frac{X''(x)}{X(x)} = \frac{1}{k}\frac{T'(t)}{T(t)} = \lambda$$
Here lambda is some constant as a function of x and t can only be equal for all x,t if they are both identically constant
Now, we solve the two linear DEs
$$X''(x) = \lambda X(x)$$
$$T'(t) = \lambda kT(t)$$
Now, the time equation gives us
$$T(t) = Ae^{(\lambda k)t}$$
Now, we need more information about the system to deduce more info, but generally natural systems decay with space and time, hence $\lambda <0$. We rewrite it as $\lambda = -\mu^2$ with $\mu > 0$
Now, we can write the general solution of $X(x)$ as
$$X(x) = B\sin(\mu x) +C\cos(\mu x)$$
Now, our general solution looks like
$$u(x,t) = e^{-\mu^2 kt}(B'\sin(\mu x) +C'\cos(\mu x))$$
$$\implies u(x,0) = B'\sin(\mu x) +C'\cos(\mu x) = x^2e^{-x^2}$$
Now we need further conditions (I think there is a spatial constrain missing, from my experience there is usually some end point boundary condition at $x=L$ which gives the harmonic modes (some insight into $\mu$).
Now, express the LHS as a fourier sum and then compare coefficients of orthogonal sin and cos functions