This implicit method takes the explicit Euler finite difference method and the implicit Euler finite difference method and deduces an “average”. This is a much better method than implicit Euler.
Explicit Euler
\begin{align}U_j^{i+1} &= U_j^i + \mu (U_{j+1}^i – 2U_j^i + U_{j-1}^i) \qquad 1 \leqslant j \leqslant M-1\\ \\
U_j^{i+1} &= \mu U_{j+1}^i + (1-2\mu)U_j^i + \mu U_{j-1}^i \tag{1}
\end{align}
Implicit Euler
\begin{align}U_j^{i+1} &= U_j^i + \mu (U_{j+1}^{i+1} \;- \; 2U_j^{i+1} + U_{j-1}^{i+1}) \qquad 1 \leqslant j \leqslant M-1 \tag{2}\\ \\
\Longrightarrow \quad U_j^i &= – \mu U_{j+1}^{i+1} + (1+2\mu)U_j^{i+1} – \mu U_{j-1}^{i+1} \tag{3}
\end{align}
Crank Nicolson
\begin{align}U_j^{i+1} &= U_j^i + \dfrac{\mu}{2} (U_{j+1}^i – 2U_j^i + U_{j-1}^i) + \dfrac{\mu}{2}(U_{j+1}^{i+1} \;- \; 2U_j^{i+1} + U_{j-1}^{i+1}) \qquad 1 \leqslant j \leqslant M-1\\ \\
&= \underbrace{\dfrac{\mu}{2} U_{j+1}^i + (1 – \mu )U_j^i + \dfrac{\mu}{2} U_{j-1}^i}_{\text{match with $U_j^i$ in $(3)$ above}} + \dfrac{\mu}{2}(U_{j+1}^{i+1} \;- \; 2U_j^{i+1} + U_{j-1}^{i+1}) \qquad 1 \leqslant j \leqslant M-1\\
\end{align}
Stability
By matching the collective $U_j^i$ terms above with $U_j^i$ in $(3)$ it is easy to see that
\begin{align} – \dfrac{\mu}{2} U_{j+1}^{i+1} + (1 + \mu)U_j^{i+1} – \dfrac{\mu}{2} U_{j-1}^{i+1} = \dfrac{\mu}{2} U_{j+1}^i + (1 – \mu )U_j^i + \dfrac{\mu}{2} U_{j-1}^i
\end{align}
Hence
$$T_I(1+\mu, \dfrac{\mu}{2})\mathbf{U^{i+1}} = T(1-\mu, \dfrac{\mu}{2}) \mathbf{U^i} $$
where
\begin{align}
T &=
\left(\begin{array}{ccccc} 1-\mu & \frac{\mu}{2} & & & \\ \frac{\mu}{2} & 1-\mu & \frac{\mu}{2} & \\ & \ddots & \ddots & \ddots & \\ & & \frac{\mu}{2} & 1-\mu & \frac{\mu}{2} \\ & & & & 1-\mu\end{array}\right) \quad \in \mathbb{R}^{(M-1) \times (M -1)}
\end{align}
and
\begin{align}
T_I &=
\left(\begin{array}{ccccc} 1+\mu & -\frac{\mu}{2} & & & \\ -\frac{\mu}{2} & 1+\mu & -\frac{\mu}{2} & \\ & \ddots & \ddots & \ddots & \\ & & -\frac{\mu}{2} & 1+\mu & -\frac{\mu}{2} \\ & & & & 1+\mu\end{array}\right) \quad \in \mathbb{R}^{(M-1) \times (M -1)}
\end{align}
For each $T (a,b)$,
$$\lambda_k = a + 2b \cos \frac{\pi k}{n + 1}\; , \qquad k = 1,2,\cdots ,n $$
Once again, the equation
$$T_I(1+\mu, \dfrac{\mu}{2})\mathbf{U^{i+1}} = T(1-\mu, \dfrac{\mu}{2}) \mathbf{U^i} $$
needs to be in a strictly evolutionary form. Therefore
$$\mathbf{U^{i+1}} = T_I(1+\mu, \dfrac{\mu}{2})^{-1}\cdot T(1-\mu, \dfrac{\mu}{2}) \mathbf{U^i} $$
The legitimacy of the above equation (in a linear algebra sense) might initially seem questionable. However we have already seen that the eigenvectors of $T(a,b)$ do not depend on $a, b$ meaning that,
all $n \times n$ TST matrices have the same eigenvectors
As a consequence, for any two matrices $\mathbf{A}$ and $\mathbf{B}$ that share common eigenvectors,
$\mathbf{A}\cdot\mathbf{B}=\mathbf{B}\cdot\mathbf{A}$, if $\mathbf{A}$ and $\mathbf{B}$ matrices have the same eigenvectors and the matrices are said to be commutable.
For $TST$ matrices with the same eigenvectors, the different $a$ and $b$ give rise to different eigenvalues.
In Stability Properties of Implicit Euler we had to similarly take the inverse of $T_I(a,b)$ and we mentioned that the eigenvalues of the inverse matrix are the inverse (reciprocal) of the matrix eigenvalues.
Hence
$$\lambda_k = \dfrac{1 – \mu + \mu \cos \dfrac{\pi k}{M}}{1+\mu \; – \mu \cos \dfrac{\pi k}{M} } \; , \qquad k = 1,2,\cdots ,n $$
To show that the eigenvalues $\lambda_k$ lie in the interval $[-1, 1]$ it might be useful to rewrite $\lambda$ keeping in mind the following trigonomteric relations
$$\cos2 \theta = \cos^2 \theta – \sin^2 \theta \quad \Longrightarrow \quad \cos \theta = \cos^2 \dfrac{\theta}{2} – \sin^2 \dfrac{\theta}{2}\\
1 – \cos^2 \dfrac{\theta}{2} = \sin^2 \dfrac{\theta}{2} \quad \Longrightarrow \quad 1 – \sin^2 \dfrac{\theta}{2} = \cos^2 \dfrac{\theta}{2}$$
From which
$$\cos \theta = \cos^2 \dfrac{\theta}{2} – \sin^2 \dfrac{\theta}{2} = 1 – \sin^2 \dfrac{\theta}{2} – \sin^2 \dfrac{\theta}{2} = 1- 2 \sin^2 \dfrac{\theta}{2} $$
Hence
$$\cos \dfrac{\pi k}{M} = 1 – 2\sin^2\dfrac{\pi k}{2M}$$
and
$$\lambda_k = \dfrac{1 – \mu + \mu( 1 – 2\sin^2\dfrac{\pi k}{2M})}{1+\mu \; – \mu (1 – 2\sin^2\dfrac{\pi k}{2M}) } = \dfrac{1 – 2\mu \sin^2\dfrac{\pi k}{2M}}{1 + 2\mu \sin^2\dfrac{\pi k}{2M} } \; , \qquad k = 1,2,\cdots ,n $$
The graph of
$$ \dfrac{1 \; – \; x}{1 + x }$$ is a hyperbola with asymptotes $(x =\; – \;1, \; y = -\;1)$.
This shows that the eigenvalues $\lambda_k$ lie in the interval $[-1, 1]$. And Crank–Nicolson is stable for any $\mu > 0$