# heat equation with inhomogenous BC and IC

I'm Zekeriya Özkan from Turkey, I'm a master student in Turkey

Can you solve the heat equation with conditions $$\frac{\partial^2u}{\partial x^2}=\frac{\partial u}{\partial t}$$ IC: $u(0,t)=1$

BC : $u_x(0,t)=U$, $u_x(1,t)=-U$

-
I guess you mean IC: $u(x,0) = 1$ right? –  Pragabhava Dec 6 '12 at 0:55
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:05

Let $u(x,t)=v(x,t)-Ux^2+Ux+1$ ,

Then $\dfrac{\partial u(x,t)}{\partial t}=\dfrac{\partial v(x,t)}{\partial t}$

$\dfrac{\partial u(x,t)}{\partial x}=\dfrac{\partial v(x,t)}{\partial x}-2Ux+U$

$\dfrac{\partial^2u(x,t)}{\partial x^2}=\dfrac{\partial^2v(x,t)}{\partial x^2}-2U$

$\therefore\dfrac{\partial v(x,t)}{\partial t}=\dfrac{\partial^2v(x,t)}{\partial x^2}-2U$ with $v(0,t)=0$ , $v_x(0,t)=0$ and $v_x(1,t)=0$

Let $v(x,t)=\sum\limits_{n=0}^\infty C(n,t)\cos n\pi x$ so that it automatically satisfies $v_x(0,t)=0$ and $v_x(1,t)=0$ ,

Then $\sum\limits_{n=0}^\infty C_t(n,t)\cos n\pi x=-\sum\limits_{n=0}^\infty n^2\pi^2C(n,t)\cos n\pi x-2U$

$\sum\limits_{n=0}^\infty C_t(n,t)\cos n\pi x+\sum\limits_{n=0}^\infty n^2\pi^2C(n,t)\cos n\pi x=-2U$

$\sum\limits_{n=0}^\infty(C_t(n,t)+n^2\pi^2C(n,t))\cos n\pi x=-2U$

$\sum\limits_{n=0}^\infty(C_t(n,t)+n^2\pi^2C(n,t))\cos n\pi x=\sum\limits_{n=0}^\infty k\cos n\pi x$ , where $k=\begin{cases}-2U&\text{when}~n=0\\0&\text{when}~n\neq0\end{cases}$

$\therefore\begin{cases}C_t(n,t)=-2U&\text{when}~n=0\\C_t(n,t)+n^2\pi^2C(n,t)=0&\text{when}~n\neq0\end{cases}$

$C(n,t)=\begin{cases}A(0)-2Ut&\text{when}~n=0\\A(n)e^{-n^2\pi^2t}&\text{when}~n\neq0\end{cases}$

$\therefore u(x,t)=\sum\limits_{n=0}^\infty A(n)e^{-n^2\pi^2t}\cos n\pi x-Ux^2+Ux-2Ut+1$

$u(0,t)=1$ :

$\sum\limits_{n=0}^\infty A(n)e^{-n^2\pi^2t}-2Ut+1=1$

$\sum\limits_{n=0}^\infty A(n)e^{-n^2\pi^2t}=2Ut$

$\therefore u(x,t)=\sum\limits_{n=0}^\infty A(n)e^{-n^2\pi^2t}\cos n\pi x-Ux^2+Ux-2Ut+1$ , where $A(n)$ is the solution of $\sum\limits_{n=0}^\infty A(n)e^{-n^2\pi^2t}=2Ut$

-