# Using implicit method to solve system analytically and finding error

Given the following problem;

$$u_t = u_{xx} + u_x; \quad\text{for} \quad 0 < x < 1, \quad t > 0$$ $$u(0,t) = 0 = u(1,t); \quad\text{for} \quad t > 0$$ $$u(x,0) = \left\{\begin{matrix} x, \quad\text{for} \quad 0\leq x \leq \frac{1}{2}\\ 1-x, \quad \text{for} \quad \frac{1}{2} \leq x \leq 1 \end{matrix}\right.$$

Using an implicit method with $Δx = 0.1$ and appropriate $Δt$ to obtain a solution at $t = 0.1,\ 0.2$ and $0.5$. Determine the analytic solution and estimate the error at $t = 1, 2$ and $5$.

• I am having a difficult time starting this. Can you please tell me how to do this? – JaneD. Nov 17 '16 at 18:15

Let $u(x,t)=X(x)T(t)$ ,

Then $X(x)T'(t)=X''(x)T(t)+X'(x)T(t)$

$X(x)T'(t)=(X''(x)+X'(x))T(t)$

$\dfrac{T'(t)}{T(t)}=\dfrac{X''(x)+X'(x)}{X(x)}=-\dfrac{16n^2\pi^2+1}{4}$

$\begin{cases}\dfrac{T'(t)}{T(t)}=-\dfrac{16n^2\pi^2+1}{4}\\X''(x)+X'(x)+\dfrac{16n^2\pi^2+1}{4}X(x)=0\end{cases}$

$\begin{cases}T(t)=c_3(n)e^{-\frac{(16n^2\pi^2+1)t}{4}}\\X(x)=\begin{cases}c_1(n)e^{-\frac{x}{2}}\sin2n\pi x+c_2(n)e^{-\frac{x}{2}}\cos2n\pi x&\text{when}~n\neq0\\c_1xe^{-\frac{x}{2}}+c_2e^{-\frac{x}{2}}&\text{when}~n=0\end{cases}\end{cases}$

$\therefore$ Take $u(x,t)=\sum\limits_{n=1}^\infty C(n)e^{-\frac{2x+(16n^2\pi^2+1)t}{4}}\sin2n\pi x$ so that it automatically satisfies $u(0,t)=u(1,t)=0$ and fit for the piecewise zones of $0\leq x\leq\dfrac{1}{2}$ and $\dfrac{1}{2}\leq x\leq1$