$$
\newcommand{\uex}{{u_{\small\mbox{e}}}}
\newcommand{\half}{\frac{1}{2}}
\newcommand{\tp}{\thinspace .}
\newcommand{\Oof}[1]{\mathcal{O}(#1)}
\newcommand{\x}{\boldsymbol{x}}
\newcommand{\dfc}{\alpha} % diffusion coefficient
\newcommand{\Ix}{\mathcal{I}_x}
\newcommand{\Iy}{\mathcal{I}_y}
\newcommand{\If}{\mathcal{I}_s} % for FEM
\newcommand{\Ifd}{{I_d}} % for FEM
\newcommand{\basphi}{\varphi}
\newcommand{\baspsi}{\psi}
\newcommand{\refphi}{\tilde\basphi}
\newcommand{\xno}[1]{x_{#1}}
\newcommand{\dX}{\, \mathrm{d}X}
\newcommand{\dx}{\, \mathrm{d}x}
\newcommand{\ds}{\, \mathrm{d}s}
$$
Details: with Dirichlet condition equation
\( N_x=2 \) and including \( u_2=D \) as a separate equation:
$$
\left(\begin{array}{ccc}
A_{0,0}& A_{0,1} & A_{0,2}\\
A_{1,0} & A_{1,1} & A_{1,2}\\
A_{2,0} & A_{2,1} & A_{2,2}
\end{array}\right)
\left(\begin{array}{c}
u_0\\
u_1\\
u_2
\end{array}\right)
=
\left(\begin{array}{c}
b_0\\
b_1\\
b_2
\end{array}\right)
$$
with \( A_{i,j} \) and \( b_i \) as before for \( i,j=1,2 \), keeping
\( u_2 \) as unknown in \( A_{1,1} \), and
$$
\begin{align*}
A_{0,2}&=A_{2,0}=A_{2,1}=0\\
A_{1,2}&=
-\frac{1}{2\Delta x^2}(\dfc(u_{1}) + \dfc(u_{2}))\\
A_{2,2}=&1,\ b_2=D
\end{align*}
$$