# Resolution of a non-homogeneous heat equation

I'm looking for solution to this non-homogeneus problem.

$\frac{\partial u}{\partial t}-\frac{\partial^2 u}{\partial x^2}=F(x,t)$ for $0<x<\pi$, $t>0$

$u(x,0)=0$

$u(0,t)=\frac{\partial u}{\partial x}(x=\pi)=0$

Does anyone know how to proceed?

-
What are the boundary conditions at the boundary of the $x$ variables? At $x=\pi$ you have specified something (is it now $u=0$ or $u'=0$?). What happens at $x=0$? –  Fabian Mar 1 '11 at 21:17
Sorry, I corrected the text –  user7663 Mar 1 '11 at 21:22
This question has been solved perfectly. Hope that the asker has been diving enough and accept the answer at an early date. –  doraemonpaul Apr 21 '13 at 2:23

In case you don't know how to get the Green's function for the boundary conditions you have: You can find the solutions of the corresponding homogeneous equation

$$\frac{\partial u}{\partial t}-\frac{\partial^2 u}{\partial x^2}=0$$

by separation of variables:

$$u(x,t)=X(x)T(t)\;,$$

$$\frac{T'}{T}=\frac{X''}{X}\;.$$

Then if you have any solution of the inhomogeneous equation that doesn't satisfy the boundary conditions, you can expand the error in the solutions of the homogeneous equation and substract the result from your solution of the inhomogeneous equation.

-

You should find the fundamental solution (Green's function) $$(\partial_t - \partial_x^2) G(x,t) = \delta(x) \delta(t)$$ where $\delta$ is the Dirac delta function. This solution depends on the boundary conditions you impose on your solution. A particular solution of the inhomogeneous equation is then given by the convolution $G \star F$. ($F$ should also obey the boundary conditions)

For your concrete boundary conditions, one can get the fundamental solution. Fourier transforming from $x$ to $k$, the homogeneous equation reads $$(\partial_t+ k^2) f=0.$$ The solution is given by $f=e^{-k^2 t}$. In order to satisfied the boundary conditions at $x=0$ and $x=\pi$, we have to add the solutions with $k$ and $-k$: $G(x,t) = \sum_k \sin(k x) e^{-k^2 t}$, where $k = \frac{1}{2} + n$ with $n\in \mathbb{N}_0$.

-
The solution to the diffusion equation with periodic boundary conditions is given by the theta function. Does the function $G(x,t) = \sum_k \sin(kx) e^{-k^2 t}$ also have a name? –  Fabian Mar 1 '11 at 22:16

Let $u(x,t)=\sum\limits_{s=0}^\infty C(s,t)\sin\dfrac{(2s+1)x}{2}$ so that it automatically satisfies $u(0,t)=\dfrac{\partial u}{\partial x}(x=\pi)=0$ ,

Then $\sum\limits_{s=0}^\infty\dfrac{\partial C(s,t)}{\partial t}\sin\dfrac{(2s+1)x}{2}+\sum\limits_{s=0}^\infty\dfrac{(2s+1)^2}{4}C(s,t)\sin\dfrac{(2s+1)x}{2}=F(x,t)$

$\sum\limits_{s=0}^\infty\biggl(\dfrac{\partial C(s,t)}{\partial t}+\dfrac{(2s+1)^2}{4}C(s,t)\biggr)\sin\dfrac{(2s+1)x}{2}=F(x,t)$

For $0<x<\pi$ , with reference to Wave equation with initial and boundary conditions - is this function right? ,

$\sum\limits_{s=0}^\infty\biggl(\dfrac{\partial C(s,t)}{\partial t}+\dfrac{(2s+1)^2}{4}C(s,t)\biggr)\sin\dfrac{(2s+1)x}{2}=\sum\limits_{s=0}^\infty\dfrac{2}{\pi}\int_0^\pi F(x,t)\sin\dfrac{(2s+1)x}{2}dx~\sin\dfrac{(2s+1)x}{2}$

$\therefore\dfrac{\partial C(s,t)}{\partial t}+\dfrac{(2s+1)^2}{4}C(s,t)=\dfrac{2}{\pi}\int_0^\pi F(x,t)\sin\dfrac{(2s+1)x}{2}dx$

$\dfrac{\partial}{\partial t}\left(e^{\frac{(2s+1)^2t}{4}}C(s,t)\right)=\dfrac{2e^{\frac{(2s+1)^2t}{4}}}{\pi}\int_0^\pi F(x,t)\sin\dfrac{(2s+1)x}{2}dx$

$e^{\frac{(2s+1)^2t}{4}}C(s,t)=\dfrac{2}{\pi}\int e^{\frac{(2s+1)^2t}{4}}\int_0^\pi F(x,t)\sin\dfrac{(2s+1)x}{2}dx~dt$

$e^{\frac{(2s+1)^2t}{4}}C(s,t)=A(s)+\dfrac{2}{\pi}\int_0^t e^{\frac{(2s+1)^2t}{4}}\int_0^\pi F(x,t)\sin\dfrac{(2s+1)x}{2}dx~dt$

$C(s,t)=A(s)e^{-\frac{(2s+1)^2t}{4}}+\dfrac{2e^{-\frac{(2s+1)^2t}{4}}}{\pi}\int_0^t e^{\frac{(2s+1)^2t}{4}}\int_0^\pi F(x,t)\sin\dfrac{(2s+1)x}{2}dx~dt$

$\therefore u(x,t)=\sum\limits_{s=0}^\infty\biggl(A(s)e^{-\frac{(2s+1)^2t}{4}}+\dfrac{2e^{-\frac{(2s+1)^2t}{4}}}{\pi}\int_0^t e^{\frac{(2s+1)^2t}{4}}\int_0^\pi F(x,t)\sin\dfrac{(2s+1)x}{2}dx~dt\biggr)\sin\dfrac{(2s+1)x}{2}$

$u(x,0)=0$ :

$\sum\limits_{s=0}^\infty A(s)\sin\dfrac{(2s+1)x}{2}=0$

$A(s)=0$

$\therefore u(x,t)=\dfrac{2}{\pi}\sum\limits_{s=0}^\infty\int_0^t e^{\frac{(2s+1)^2t}{4}}\int_0^\pi F(x,t)\sin\dfrac{(2s+1)x}{2}dx~dt~e^{-\frac{(2s+1)^2t}{4}}\sin\dfrac{(2s+1)x}{2}$

$u(x,t)=\dfrac{2}{\pi}\sum\limits_{s=0}^\infty\int_0^t e^{\frac{(2s+1)^2\tau}{4}}\int_0^\pi F(\xi,\tau)\sin\dfrac{(2s+1)\xi}{2}d\xi~d\tau~e^{-\frac{(2s+1)^2t}{4}}\sin\dfrac{(2s+1)x}{2}$

$u(x,t)=\dfrac{2}{\pi}\int_0^t\int_0^\pi\sum\limits_{s=0}^\infty e^{-\frac{(2s+1)^2(t-\tau)}{4}}\sin\dfrac{(2s+1)x}{2}\sin\dfrac{(2s+1)\xi}{2}F(\xi,\tau)~d\xi~d\tau$

-