# Using Fourier Transform to solve heat equation

the heat equation of $U(x,t)$ on $-\infty<x<+\infty$ and $t>0$ is $$U_t=U_{xx}+\exp\left({\frac{-x^2}{2}}\right)$$ where $$U(x,t)\rightarrow 0 \quad as\quad x\rightarrow\pm\infty$$ and the initial condition is $$U(x,0)=0$$

That's what i tried... I not sure if it's correct, but use the cos transform to solve this equation

by firstly, let $$u(s,t)=\int_{0}^{+\infty}{U(x,t)\cos(sx)}dx$$ then, taking the fourier cos transform for both side of the PDE $$u_t=\int_{0}^{+\infty}{U_{xx}\cos(sx)}dx+\int_{0}^{+\infty}{\exp\left({\frac{-x^2}{2}}\right)\cos(sx)}dx$$ $$u_t=[\cos(sx) U_x]_{0}^{+\infty} + s\int_{0}^{+\infty}{U_{x}\sin(sx)}dx +\sqrt{\frac{\pi}{2}}\exp\left({\frac{-x^2}{2}}\right)$$ $$u_t=[\cos(+\infty s)U_x(+\infty,s) - U_x(0,s)] + s\{[\sin(sx)U]_{0}^{+\infty}- s\int_{0}^{+\infty}{U\cos(sx)}dx\} +\sqrt{\frac{\pi}{2}}\exp\left({\frac{-x^2}{2}}\right)$$ by appling the properities and conditions, I got $$u_t=[0 - 0] + s\{0- su\} +\sqrt{\frac{\pi}{2}}\exp\left({\frac{-s^2}{2}}\right)$$ finaly get the $1^st$ order ODE $$u_t + s^2 u = \sqrt{\frac{\pi}{2}}\exp\left({\frac{-s^2}{2}}\right)$$

Up to here, I thinks there should have some mistakes in the processes... but I cannot find them..or my approaching is in a wrong method...?

Why are you restricting yourself to $x \in (0,\infty)$ when the domain is for the entire real line? In this case, it seems easier to go with Fourier transforms, i.e.,

$$u(s,t) = \int_{-\infty}^{\infty} dx \, U(x,t) \, e^{i s x}$$

Then the PDE becomes

$$u_t + s^2 u = \sqrt{2 \pi} \, e^{-s^2/2} = e^{-s^2 t}\frac{d}{dt}\left [e^{s^2 t} u \right ]$$ $$u(s,0)=0$$

$$\implies u(s,t) = \sqrt{2 \pi} \, e^{-s^2/2} \frac{1-e^{-s^2 t}}{s^2}$$

Now inverse FT...use the fact that

$$\frac{1-e^{-s^2 t}}{s^2} = \int_0^t dt' \, e^{-s^2 t'}$$

and get

$$U(x,t) = \int_0^t dt' \, (1+2 t')^{-1/2} \, e^{-x^2/[2 (1+2 t')]}$$

• wow.. thanks..er... I use the book <laplace transforms>-Spiegel where I cannot find formulas of the Fourier transform for $\frac{d^2 U}{dx^2}$ from infinity to infinity, and the solution of this equation looks like a even function ...thus, i try to use cos transform... – leave2014 Aug 26 '14 at 13:36
• @leave2014: it should work out all the same, but you restricted yourself to positive $x$. Thus, when you integrated by parts, you ended up with this unknowable boundary value at $x=0$. – Ron Gordon Aug 26 '14 at 13:40
• thanks all of you.. it's helpful... b.t.w where can I find the method about take the fourier transform for $U_xx$ from -inf to -inf – leave2014 Aug 26 '14 at 13:49
• @leave2014: in any book on FT's. – Ron Gordon Aug 26 '14 at 14:03