# Heat Equation $1D$ with forcing term

For an one-dimensional bar that goes from $x=0$ to $x=1$ and with $t$ belonging to $0$ to $+\infty$.

$u_t=u_{xx}+\sin\pi x+\sin 2\pi x\\ u(0,t)=u(1,t)=0\\ u(x,0)=0$

I recognize that this is a forced heat equation problem, with homogeneous Dirichlet boundary conditions and an initial condition fairly unusual.

I suspect that I have to first solve the homogeneous cousin $u_t=u_{xx}$ with same conditions and later try to find the non-homogeneous solution. But the initial condition puts the fourier coefficients equal zero, meaning trivial solution.

What am I not understanding?

• Solve first $u_{xx}=\sin(\pi x)+\sin(2\pi x)$, this will give you the stationary temperature $u_{st}$. Then put $u=u_{st}+v$ and get for $v$ a homogeneous heat equation with nonzero initial conditions. – Artem Feb 2 '13 at 15:00
• Ok, let me see if I can get it to work. – Dan Feb 2 '13 at 15:03
• @Artem Thanks, I got it. – Dan Feb 2 '13 at 16:08
• Are you sure? I made a type in the equation you need to solve. It has to have minus before both sine functions. You can post your own answer if you'd like someone check it. – Artem Feb 2 '13 at 16:37
• Well, If i got it straight you want me to define a function $u_{gt}$ so that the equation ends up only $v_t = v_{xx}$ (as the temporal derivative of $u_{gt}$ is zero and the second x derivative cancels the sinuses). I can easily find $w = sin(\pi x)/\pi^2 + sin(2 \pi x)/(4 \pi^2) + c_1x+c_2$ Then there is a fight for the conditions, the conditions end up: $v(0,t) = -c_2; v(1,t) = - c_1 - c_2; v(x,t) = - w(x)$ And from them on its just a nasty, but ordinary problem with non-homogeneous boundary conditions. – Dan Feb 2 '13 at 17:01

FIrst solve the equation $$u''=-\sin \pi x-\sin 2\pi x,$$ subject to the boundary conditions $$u(0)=u(1)=0.$$ This problem has solution $$u_{st}=\frac{1}{\pi^2}\sin \pi x+\frac{1}{2^2\pi^2}\sin 2\pi x.$$ Now put $u(x,t)=u_{st}+v(x,t)$. Make sure that you understand that $v(x,t)$ solves the problem $$v_t=v_{xx},\\ v(0,t)=0,\\ v(1,t)=0,\\ v(x,0)=-u_{st}.$$ Note the initial condition.
Now you can solve it to find $$v(x,t)=-\frac{1}{\pi^2}e^{-\pi^2 t}\sin \pi x-\frac{1}{2^2\pi^2}e^{-2^2\pi^2t}\sin 2\pi x.$$ Finally write $$u(x,t)=\underbrace{v(x,t)}_{\mbox{transient part}}+\underbrace{u_{st}}_{\mbox{stationary part}}$$