# Convergence and Stability of Explicit and Implicit Schemes in the Simulation of the Heat Equation
## 4 Explicit Methods: Centered, Forward and Backward in Time Differences
### Direct Finite Difference of First Order  
Consider a Taylor series expansion \(\phi\left(x\right)\) over the point.  
\[\phi\left(x_{i}+\delta x\right)=\varnothing(x_{i})+\delta x \tag{3}\]  
\(\phi\left(x\right)\) first order direct difference. Consider a Taylor series expansion \(\phi\left(x\right)\) over the point  
\[\phi(x_{i}+\delta x)=\phi(x_{i})+\left.\delta x\frac{\partial\phi}{\partial x }\right|_{x_{i}}+\frac{\delta x^{2}}{2}\frac{\partial^{2}\phi}{\partial x^{2} }\right|_{x_{i}}+\left.\frac{\delta x^{3}}{3!}\frac{\partial^{3}\phi}{\partial x ^{3}}\right|_{x_{i}}+\ldots \tag{4}\]  
where \(\delta x\) is a change in x to relative to \(x_{i}\). Let \(\delta x=\Delta x\) in Equation (4), that is, consider the value \(\varnothing\) at the location of the mesh line \(x_{i}+1\), i.e., \(\varnothing(x_{i}+\Delta x)=\varnothing(x_{i})+\Delta x\) Note that the powers of multiply partial derivatives to the right-hand side have been reduced by one. The approximate solution is replaced by the exact solution, i.e., using \(\varnothing_{i}\approx\varnothing(x_{i})\)\(y\)\(\varnothing_{i}+1\approx\varnothing(x_{i}+\Delta x)\)  
\[\frac{\partial\phi}{\partial x}\bigg{|}_{x_{i}}\approx\frac{\phi_{i+1}-\phi_{ i}}{\Delta x}-\frac{\Delta x}{2}\frac{\partial^{2}\phi}{\partial x^{2}} \bigg{|}_{x_{i}}-\frac{\Delta x^{3}}{3!}\frac{\partial^{3}\phi}{\partial x^{3 }}\bigg{|}_{x_{i}}+\ldots \tag{5}\]  
The mean value theorem can be used to replace the higher-order derivatives  
\[\frac{\partial\phi}{\partial x}\bigg{|}_{x_{i}}\approx\frac{\phi_{i+1}-\phi_{ i}}{\Delta x}+\frac{\Delta x^{2}}{2}\left.\frac{\partial^{2}\phi}{\partial x ^{2}}\right|_{\varepsilon}\]  
or  
\[\frac{\partial\phi}{\partial x}\bigg{|}_{x_{i}}-\frac{\phi_{i+1}-\phi_{i}}{ \Delta x}\approx\frac{\Delta x^{2}}{2}\left.\frac{\partial^{2}\phi}{\partial x ^{2}}\right|_{\varepsilon} \tag{6}\]  
The term on the right-hand side of Equation (6) is called the truncation of the finite difference approximation. It is the error that results from truncating the series in Equation (5). In general, \(\xi\) is not known and is determined from the simulation. Although in the exact magnitude the truncation error cannot be known (unless the true solution \(\mathcal{O}\)\((x,t)\) is known analytically). The notation \"O\" can be used to express the dependence of the truncation error on the mesh spacing. The right-hand side of Equation (6) contains the mesh spacing \(\Delta x\), which is selected for convenience.  
The equal sign in this expression is true in the order of magnitude sense. That is, the O = \(\Delta x^{2}\) on the right-hand side of the expression is not strictly equal. Rather, the expression means that the left-hand side is a product of an unknown constant and \(\Delta x^{2}\). Although the expression does not give the exact magnitude of the error, it tells us how fast that term approaches zero as \(\Delta x\) becomes smaller. Using the notation O large, one can write Equation (5) as  
\[\frac{\partial\phi}{\partial x}\bigg{|}_{x_{i}}=\frac{\phi_{i+1}-\phi_{i}}{ \Delta x}+\text{O}(\Delta x) \tag{7}\]  
The Equation (7) is known as the forward difference formula for \(\left(\frac{\partial\varnothing}{\partial x}\right)\)\(x_{i}\) because it involves \(x_{i}\) and \(x_{i+1}\) nodes. The forward difference approximation has a truncation error that is O (\(\Delta x\)). The size of the truncation error is under control because the mesh size \(\Delta x\) can be chosen.