# Euler Method in R for the Initial Value Problem

15 Jan 2016During differentiation, the value of whatever vertical shift is present is lost as a result of the elimination of the constant term, which has a derivative of 0. We normally acknowledge this when integrating a function by adding a [latex]+ C[/latex] constant, the constant of integration, to an indefinite integral. This is sometimes a nonissue since, if finding the value of a definite integral, the constant terms cancel and the constant of integration is unnecessary.

For ordinary differential equations, them there is no convenient cancellation, leading to the initial value problem. The initial value problem provides a value of [latex]f(x_0)[/latex], where [latex]x_0[/latex] is normally 0, but is not required to be. This initial value provides sufficient information to complete the solution and find the actual value of [latex]f(x)[/latex] for some value of [latex]x[/latex]. Below is an implementation of the Euler method in R.

*Image by Oleg Alexandrov via Wikipedia Commons.*