# 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$

-
Özkan, Welcome to math.SE: since you are new, we wanted to let you know a few things about the site. In order to get the best possible answers, it is helpful if you say in what context you encountered the problem, and what your thoughts on it are; this will prevent people from telling you things you already know, and help them give their answers at the right level. If this is homework, please add the homework tag; people will still help, so don't worry. Also, many find the use of imperative ("Prove", "Solve", "Find", etc.) to be rude when asking for help; please consider rewriting your post. –  user17762 Nov 18 '12 at 9:55
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$

-