# How to rewrite a 2nd order nonlinear ODE into an initial value problem of first order?

I am trying to rewrite the initial value problem

$x''(t) = -sin(x(t))$ with initial values $x(0)= \pi/2$ and $x'(0) = 0$ into and initial value problem of first order ODE system.

Later I will have to implement some methods (Explicit/Implicit Euler) to solve this IVP so any help would be very much appreciated.

I do know how to rewrite a linear 2nd order ODE into a system of 1st order of the form $x''(t)+g(t)*x'(t)+s(t)x(t)=g(t)$ but here I not know how to proceed because of the nonlinearity.

The technique works exactly the same as it does for a second-order linear ODE; define $y = x'(t)$, and then you have a first-order system in two variables: \begin{align*} x'(t) &= y(t) \\ y'(t) &= - sin(x(t)) \qquad \text{(since $y' = x''$)} \end{align*}
• so you mean the first oder system is simply $d/dt (y(t),y'(t)) = (y'(t),-sin(y(t)))$ ? – Isabel Apr 6 '17 at 15:07
• @Isabel: Basically, though I think you made a typo in your comment. (Your notation isn't consistent; you should either use $x$ & $x'$, or $y$ & $y'$, or $x and$y\$.) – Michael Seifert Apr 6 '17 at 15:09