Usando diferencias finitas centradas $$ \begin{align*} \frac{\partial^{2} T}{\partial x^{2}} &= \frac{T_{i+1, j} - 2 T_{i, j} + T_{i-1, j}}{\Delta x^{2}} \\ \frac{\partial^{2} T}{\partial y^{2}} &= \frac{T_{i, j+1} - 2 T_{i, j} + T_{i, j-1}}{\Delta y^{2}} \end{align*} $$
Sustituyendo $$ \begin{equation*} \frac{T_{i+1, j} - 2 T_{i, j} + T_{i-1, j}}{\Delta x^{2}} + \frac{T_{i, j+1} - 2 T_{i, j} + T_{i, j-1}}{\Delta y^{2}} = 0 \end{equation*} $$
Para una malla cuadrada \( \Delta x^{2} = \Delta y^{2} \) $$ \begin{equation*} \frac{T_{i+1, j} - 2 T_{i, j} + T_{i-1, j}}{\Delta x^{2}} + \frac{T_{i, j+1} - 2 T_{i, j} + T_{i, j-1}}{\Delta x^{2}} = 0 \end{equation*} $$
reordenando $$ \begin{equation*} T_{i-1, j} - 4 T_{i, j} + T_{i+1, j} + T_{i, j-1} + T_{i, j+1} = 0 \end{equation*} $$