We have piecewise diffusion equation
$u_{t}(x,t)=\left\{\begin{matrix} D_{1}u_{xx}(x,t) &x\in(0,1) \\ D_{2}u_{xx}(x,t) & x\in (1,2)\end{matrix}\right.$,
with IC:
$u(x,0)=2x+1$
and BC :
$u(0,t)=1$ and $u(2,t)=5$, $\lim_{x\uparrow 1}u=\lim_{x\downarrow 1}u$ and $\lim_{x\uparrow 1}D_{1}u_{x}=\lim_{x\downarrow 1}D_{2}u_{x}$.
Attempt
By splitting $u=v(x)+w(x,t)$, steady state and transient solutions, we can find each one. The first is easy
$$v(x)=\left\{\begin{matrix}\frac{D_{2}}{D_{1}}\frac{u_{R}-u_{L}}{\frac{D_{2}}{D_{1}}+1}x+u_{L} & x\in(0,1)\\ \frac{u_{R}-u_{L}}{\frac{D_{2}}{D_{1}}+1} x+\frac{(\frac{D_{2}}{D_{1}}-1)u_{R}+2u_{L}}{\frac{D_{2}}{D_{1}}+1} & x\in (1,2). \\ \end{matrix}\right.$$
The w(x,t) satisfies the Dirichlet BC heat equation because $w(0,t)=u(0,t)-v(0)=0$ and similarly $w(2,t)=0$.
Assuming separable solution $w=T(t)X(x)$ we get $X''=k_{1}X$ and $X''=k_{2}X$ for $(0,1),(1,2)$ respectively for some constants $k_{1},k_{2}$. If they are both zero, we get $X$ linear. If positive we get $Acosh(\sqrt{k_{1}}x)+Bsinh(\sqrt{k_{1}}x)$, $Ccosh(\sqrt{k_{2}}x)+Dsinh(\sqrt{k_{2}}x)$ for each interval respectively. If negative we get $Acos(\sqrt{-k_{1}}x)+Bsin(\sqrt{-k_{1}}x)$, $Ccos(\sqrt{-k_{2}}x)+Dsin(\sqrt{-k_{2}}x)$
The $w(0,t)=0$ gives A=0. But the other conditions give
$$Bsinh(\sqrt{k_{1}})=Ccosh(\sqrt{k_{2}})+Dsinh(\sqrt{k_{2}})$$
$$B\sqrt{k_{1}}cosh(\sqrt{k_{1}})=C\sqrt{k_{2}}sinh(\sqrt{k_{2}})+D\sqrt{k_{2}}cosh(\sqrt{k_{2}})$$
$$Ccosh(2\sqrt{k_{2}})+D\sqrt{k_{2}}sinh(2\sqrt{k_{2}})=0$$
Any suggestions?

