Discrete solution of a differential equation

Consider discretising the equation at points $\se{x_n}$ spaced by $h$ and take $y_n = y(x_n)$. We can estimate the derivative by the forward Euler scheme $$ \frac{dy}{dx}\Big|_{x_n} \approx \frac{y_{n+1} - y_n}{h}. $$

For second-order derivative, $$\begin{align*} \frac{d^2y}{dx^2}\Big|_{x_n} &\approx \frac{dy/dx\big|_{x_{n+1}} - dy/dx\big|_{x_n}}{h} \\ &= \frac{y_{n+2} - 2y_{n+1} + y_n}{h^2}. \end{align*}$$

Example of a discrete solution