# Boundary conditions

#### Markov

##### Member
1) Transform the problem so that boundary conditions turn to homogeneous ones assuming that $g_0$ and $g_1$ are differentiable.

\begin{align} &{{u}_{t}}=K{{u}_{xx}},\text{ }0<x<L,\text{ }t>0, \\ &{{u}_{x}}(0,t)={{g}_{0}}(t),\text{ }{{u}_{x}}(L,t)={{g}_{1}}(t),\text{ for }t>0, \\ &u(x,0)=f(x),\text{ for }0<x<L. \end{align}

2) Same as above:

\begin{align} & {{u}_{t}}=K{{u}_{xx}},\text{ }0<x<L,\text{ }t>0, \\ & u(0,t)={{h}_{0}}(t)\text{ for }t>0, \\ & {{u}_{x}}(L,t)+\alpha u(L,t)={{h}_{1}}(t),\text{ for }t>0, \\ & u(x,0)=f(x),\text{ for }0<x<L. \end{align}

Well first one is pretty much alike to other one I posted, but it now contains first derivative in the boundary conditions so I'd like to know how to proceed. Second one looks harder, I don't see how to start.

#### dwsmith

##### Well-known member
1) Transform the problem so that boundary conditions turn to homogeneous ones assuming that $g_0$ and $g_1$ are differentiable.

\begin{align} &{{u}_{t}}=K{{u}_{xx}},\text{ }0<x<L,\text{ }t>0, \\ &{{u}_{x}}(0,t)={{g}_{0}}(t),\text{ }{{u}_{x}}(L,t)={{g}_{1}}(t),\text{ for }t>0, \\ &u(x,0)=f(x),\text{ for }0<x<L. \end{align}

2) Same as above:

\begin{align} & {{u}_{t}}=K{{u}_{xx}},\text{ }0<x<L,\text{ }t>0, \\ & u(0,t)={{h}_{0}}(t)\text{ for }t>0, \\ & {{u}_{x}}(L,t)+\alpha u(L,t)={{h}_{1}}(t),\text{ for }t>0, \\ & u(x,0)=f(x),\text{ for }0<x<L. \end{align}

Well first one is pretty much alike to other one I posted, but it now contains first derivative in the boundary conditions so I'd like to know how to proceed. Second one looks harder, I don't see how to start.
Here is an example
$u_t-5u_{xx}=t^2$
$u_x(0,t)=\sin(t)$
$u(1,t)=2$
$u(x,0)=e^x$

Let $K(x,t)$ be any known function and $u(x,t)=v(x,t)+K(x,t)$
Since the B.C. are linear, $Su=S(v+K) = Sv+SK$.

$v_x(0,t)+K_x(0,t)=\sin(t)\Leftrightarrow v_x(0,t)=\sin(t)-K_x(0,t)$
$v(1,t)=2-K(1,t)$
$v(x,0)=e^x-K(x,0)$

Let's try to find a $K(x,t)$ that satisfies the BCs.

For $v(1,t)$ set $K(1,t)=2$ (1) so $K(x,t)=2$
$K_x(0,t)=\sin(t)$ (2) so $K(x,t)=x\sin(t)$
Satisfying both $K(x,t)=x\sin(t)-\sin(t)+2$

Take appropriate derivatives $K_t, K_{xx}$ and plug in

$v_t-5v_{xx}=t^2+\cos(t)-x\cos(t)$
$v_x(0,t)=0$
$v(L,t)=0$
$v(x,0)=e^x-2$

Next need to show $K_t-5K_{xx}=t^2$ (3)
$K(x,t)=\frac{t^3}{3}$ Then
$v_t-5v_{xx}=0$
$v_x(0,t)=\sin(t)$
$v(L,t)=2-\frac{t^3}{3}$
$v(x,0)=e^x$

However, we can't find a $K(x,t)$ for this example that satisfies (1), (2), and (3). If we could, we would use the method of eigenfunction expansion like I did in a previous post.

But now you know how to approach these problems.