## 10.1 The Euler Method

What we mean by solving a differential equation is finding a mathematical function that satisfies it. These solutions can either be analytical (i.e. in functional form such as $$y(t) = 3t^3 + 5t$$) or numerical (i.e. as a list of $$(t,y)$$ numbers). The Euler method is one of the simplest (albeit somewhat inefficient) approaches to solving a differential equation, numerically. The basic idea behind the method is represented by the equations:

\begin{align} \text{ Diff. equation}:&\qquad\dfrac{dy}{dt} = f(y,t) \\ \text{ Initial condition}:&\qquad y(t_a) = y_a\\ \text{ Euler}:&\qquad y_{n+1} = y_{n} + f(t_n,y_n) h \\ \text{ Time step}:&\qquad t_{n+1} = t_{n} + h \end{align}

This is based on truncating (chopping off) something called the Taylor series expansion for $$y$$ at a point (shown alongside) $y(t+h) \approx f(t) + f'(t)h + f''(t)\dfrac{h^2}{2!} + f'''(t) \dfrac{h^3}{3!}+\ldots$. There are truncation errors due to us dropping the higher order terms in the Taylor series. There are other (more complicated) methods (such as the Runge-Kutta shown alongside)E.g. the Runge-Kutta method: \begin{align}y_{n+1} &= y_n +\dfrac{h}{6}\left({k_1+2k_2+2k_3+k_4} \right)\\k_1 &= f \left( {t_n,y_n} \right)\\k_2 &= f \left( {t_n+\dfrac{h}{2},y_n+\dfrac{h}{2}\cdot k_1}\right) \\k_3 &= f \left( {t_n+\dfrac{h}{2},y_n+\dfrac{h}{2}\cdot k_2}\right) \\k_4 &= f \left( {t_n+h,y_n+h\cdot k_3}\right) \\\end{align} that are more accurate.