TITLE: Solve Heat Equation using Fourier Transform (non homogeneous)
QUESTION [5 upvotes]: I know how to solve heat equation where it's like $u_t=k\cdot u_{xx}$ (using Fourier Transform or using Separation of Variables) but this exercise is really difficult for me.
I have this:
$$u_t(x,t)=k \cdot u_{xx}(x,t)-a\cdot k \cdot u(x,t)$$
$$u_x(0,t)=0$$
$$u(x,0) = f(x)$$
with $x>0, t>0$ and $a, k$ are positive constants.
I have to find $u(x,t)$ and propose a possible $f(x)$
Any help? Thanks
I was told I cannot use Fourier Transform, I have to use Fourier Cosine Transform, and I don't know why

REPLY [2 votes]: Indeed, this problem should be solved with Fourier cosine transform rather than Fourier transform. If you use Fourier transform, you won't be able to take the b.c. at $x=0$ into consideration, and the equation will then be solved in $-\infty<x<\infty$ with implicit b.c.s at $\pm\infty$. (For this part check this post for more information. )
The key point is, when $f(\infty)=0$, Fourier cosine transform
$$
\mathcal{F}_t^{(c)}[f(t)](\omega)=\sqrt{\frac{2}{\pi }}\int _0^{\infty } f(t) \cos  (\omega t) d t
$$
has the following property:
$$
\mathcal{F}_t^{(c)}\left[f''(t)\right](\omega)=-\omega^2 \mathcal{F}_t^{(c)}[f(t)](\omega)-\sqrt{\frac{2}{\pi }} f'(0)
$$
You can easily verify this property using integration by parts.
So, by applying this property on your equation, we have
$$
\mathcal{F}_x^{(c)}\left[u^{(1,0)}(t,x)\right](\omega )=k \left(-\omega ^2 \mathcal{F}_x^{(c)}[u(t,x)](\omega )-\sqrt{\frac{2}{\pi }} u^{(0,1)}(t,0)\right)-a k \mathcal{F}_x^{(c)}[u(t,x)](\omega )
$$
Substitute the b.c. into the equation, we obtain a simple initial value problem (IVP) of linear ODE:
$$U'(t)=-a k U(t)-k \omega ^2 U(t)$$
$$U(0)=F$$
where $U(t)=\mathcal{F}_x^{(c)}[u(t,x)](\omega )$, $F=\mathcal{F}_x^{(c)}[f(x)](\omega)$.
If you have difficulty in solving the IVP, check the wikipedia page). Anyway, we can easily find its solution:
$$U(t)=F e^{-k t \left(a + \omega ^2\right)}$$
The last step is to transform back with inverse Fourier Cosine transform
$${\mathcal{F}_\omega^{(c)}}^{-1}[F(\omega)](t)=\sqrt{\frac{2}{\pi }} \int_0^{\infty } F(\omega ) \cos (t \omega) \, d\omega $$
and the solution is
$$
u(t,x)=\sqrt{\frac{2}{\pi }} \int_0^{\infty } e^{-k t \left(a + \omega ^2\right)} \mathcal{F}_x^{(c)}[f(x)](\omega ) \cos (\omega  t) \, d\omega
$$
Notice this solution is probably the same as the one given by doraemonpaul. I guess he has just chosen a different convention for Fourier parameters.