I'm trying to solve this IVP for heat equation, $$u_t-\frac{1}{4}u_{xx}=e^{-t}~~\text{ in }-\infty<x<\infty,~t>0,$$ $$u(x,0)=x^2.$$ By the superposition principle, the solution should equal to a particular solution + the general solution. I find one particular solution could be $-e^{-t}.$ Thus, we have $u(t,x)=v-e^{-t}$ where $v$ is the general solution. Now we have $$v_t-\frac{1}{4}v_{xx}=0~~\text{ in }-\infty<x<\infty,~t>0,$$ $$v\Big|_{t=0}=x^2+e^{-t}.$$ I had trouble to solve the general solution. I think I could use heat kernel, $$v=\int_{-\infty}^{\infty}\frac{1}{\sqrt{4\pi kt}}e^{-\frac{(x-y)^2}{4kt}}y^2~dy,$$ but I don't how to solve this since I am required to write the solution as a linear combination, $u=C_1f_1(t)g_1(x)+\cdots+C_nf_n(t)g_n(x)$, not in $\mathscr{E}rf[u]$.
I don't know how to solve this.
First you need to use tools from tempered distribution. Then you need to recognise that $\forall T \in S(\mathbb{R})$ its fourier transformation has the property of $<\hat{T},\phi> = <T,\hat{\phi}> = \hat{\phi}(0) $ where S is Schwarz class function and $\phi$ is some test function.
The solution to your auxiliary problem is: $$v(x,t) = \frac{1}{\sqrt{\pi t}}\int_{\mathbb{R}} e^{\frac{-|x-y|^2}{t}}(x^2 + e^{-t})\ dx$$
edit: the general solution to the Heat Cauchy Problem, i.e. $u_t - u_{xx} = f$ & initial condition of $u_o$, is quite standard $$ u(x,t) = K(x,t) \ast u_o + \int_0^t K(x, t-s) \ast f(x,s) \ ds$$ where $K(x,t)$ is your heat kernel.