The question gives that
$$u_{t}=Du_{xx}$$
where the boundaries are
IC: $$u(x,0)=0$$
BC1: $$u_x(L,t)=0$$
BC2: $$u(0,t)=C_0.$$
I have solved for the steady-state equation of for this, which equals to be $$u_{ss}(x)=C_0$$ and found that
$$\sum_{n=1}^\infty B_ncos(\frac{(n-1/2pi) x}{L})e^{D\frac{(n-1/2pi)}{L}^2t}$$
How do we solve for Bn in this case?
Thanks!
Let $v(x,t)=u(x,t)-C_0$. Then $$ v_t = u_t = Du_{xx}=Dv_{xx} \\ v(x,0) = u(x,0)-C_0 = -C_0 \\ v_x(L,t) = u_x(L,t) = 0 \\ v(0,t) = u(0,t)-C_0 = 0. $$ The homogeneous endpoint conditions in $x$ at $0,L$ work out great for separation of variables. The separated solutions have the form $$ v_n(x,t) = e^{-D(n+1/2)^2\pi^2 t/L^2}\sin((n+1/2)\pi x/L),\;\; n=0,1,2,3,\cdots. $$ The general solution is $$ u(x,t)=C_0+\sum_{n=0}^{\infty}E_ne^{-D(n+1/2)^2\pi^2 t/L^2}\sin((n+1/2)\pi x/L). $$ It is easy to verify that $$ u_t = Du_{xx} \\ u(0,t) = C_0 \\ u_x(L,t) = 0 \\ u(x,0) = C_0+\sum_{n=0}^{\infty}E_n\sin((n+1/2)\pi x/L) $$ The constants $E_n$ are determined by the requirement that $u(x,0)=0$: $$ \sum_{n=0}^{\infty}E_n\sin((n+1/2)\pi x/L)= - C_0. $$ This can be accomplished on $(0,L)$, but not at the endpoints $x=0,L$, unless $C_0=0$. The constant function can be expressed as a sine series; the functions $\sin((n+1/2)\pi x/L)$ are mutually orthogonal on $[0,L]$ because of the Sturm-Liouville conditions where the functions vanish at $0$ and their first derivatives vanish at $L$. That determines the constants $E_n$.