As suggested in the comments, higher-order ODEs are rewritten as a system of first-order ODEs. To illustrate this, an example is provided below.
Let us consider the ODE $x^{(4)} + x^{(3)} + x'' + x' + x = y(t)$, with $x(t_0) = x_0$, $x'(t_0) = \dot x_0$, $x''(t_0) = \ddot x_0$, $x^{(3)}(t_0) = \dddot x_0$. Using the vector notation $\boldsymbol{x} = (x,x',x'',x^{(3)})^\top = (x_1,x_2,x_3,x_4)^\top$, the ODE is rewritten
$$
\underbrace{
\left(
\begin{array}{c}
x'_1 \\
x'_2 \\
x'_3 \\
x'_4
\end{array}
\right)}_{\boldsymbol{x}'}
=
\underbrace{
\left(
\begin{array}{c}
x_2 \\
x_3 \\
x_4 \\
y(t) - x_4 - x_3 - x_2 - x_1
\end{array}
\right)}_{\boldsymbol{f}(\boldsymbol{x},t)} ,
$$
with the initial condition $\boldsymbol{x}(t_0) = (x_0,\dot x_0,\ddot x_0, \dddot x_0)^\top = \boldsymbol{x}_0$. Then the Runge-Kutta 4 method writes
$$
\boldsymbol{x}_{n+1} = \boldsymbol{x}_{n} + \frac{h}{6} \left(\boldsymbol{k}_1 + 2\boldsymbol{k}_2 + 2\boldsymbol{k}_3 + \boldsymbol{k}_4\right),
$$
where
$$
\begin{aligned}
\boldsymbol{k}_1 &= \boldsymbol{f}(\boldsymbol{x}_n, t_n) \, ,\\
\boldsymbol{k}_2 &= \boldsymbol{f}(\boldsymbol{x}_n + \tfrac{h}{2}\boldsymbol{k}_1, t_n + \tfrac{h}{2}) \, ,\\
\boldsymbol{k}_3 &= \boldsymbol{f}(\boldsymbol{x}_n + \tfrac{h}{2}\boldsymbol{k}_2, t_n + \tfrac{h}{2}) \, ,\\
\boldsymbol{k}_4 &= \boldsymbol{f}(\boldsymbol{x}_n + h \boldsymbol{k}_3, t_n + h ) \, .
\end{aligned}
$$
How will I write the corresponding equations for k1,...k4 for the above?
– Abhishek Agarwal Jan 23 '18 at 03:31