Laplace's and Poisson's Equations, final discretized version

Inserting in Laplace's equation we obtain $$ \begin{equation} \tag{17} u_{i,j}= \frac{1}{4}\left[u_{i,j+1}+u_{i,j-1}+u_{i+1,j}+u_{i-1,j}\right]. \end{equation} $$

This is our final numerical scheme for solving Laplace's equation. Poisson's equation adds only a minor complication to the above equation since in this case we have $$ \begin{equation*} u_{xx}+u_{yy}=-\rho(x,y), \end{equation*} $$ and we need only to add a discretized version of \( \rho(\mathbf{x}) \) resulting in $$ \begin{equation} \tag{18} u_{i,j}= \frac{1}{4}\left[u_{i,j+1}+u_{i,j-1}+u_{i+1,j}+u_{i-1,j}\right] +\frac{h^2}{4}\rho_{i,j}. \end{equation} $$