I'd like to solve this system using RK4, on octave: $$ y''(x)+\sin(x)y(x)=0 \\~\\ y(0)= α,~~~ y'(0)= β $$
I know we have to first write $z(x) = y'(x)$ so we have $z'(x)=y''(x)=-\sin(x)y(x)$ and $z(0)=β$. However, for RK4, we need to know what's y' as a function of the other values, to do: \begin{align} K_{11}&=h·y'(X_n,Y_n,Z_n), \\ K_{12} &= h·z'(X_n,Y_n,Z_n) \\ K_{21} &= h·y'(X_n+(h/2), Y_n+(K_{11}/2), Z_n+(K_{12}/2)) \end{align} etc... (with $h$ the step)
To then calculate: $$ Y_{n+1}= Y_n+ (1/6)(k_1+2k_2+2k_3+k_4) $$
How can I find $y'$ as a function of $x$, $y$ and $z$? Since we need it to do the approximation but we do not have it by default in the main equation.