I am going to calculate/program a ball falling downwards (with air resistance), which means I am going to calculate this:
$$ma= \frac12 pdav^2-gm.$$
The problem with trying to learn it online which I have been doing for some time now is that they all have the formula in front of them, and they just plug in numbers. I have a lot of small stupid questions because of this so bear with me.
First I am solving for $a$, the acceleration:
$$a=\dfrac{\frac 12pdav^2-g}{m}$$
Then I turn it into a second order differential equation: $$x''=\frac{\frac 12pdax'^2-g}{m}$$
I then rewrite it into a system of first order differential equations:
$$\begin{cases}\frac {dv}{dt} &=& \frac{\frac 12pdav^2-g}{m}\\ \frac {dx}{dt} &=& v \end{cases}$$
If I actually were to solve for these numerically would I then find the position at $x(t)$, and the velocity at $v(t)$?
What are my functions $f()$, and $g()$? How do I know what kind of variables go inside there? if $f()$ is a function of $f(t,x,v) = \frac {dx}{dv}$ the only variable I can insert is $v$. Is it therefore only a function of $v$? So $f(v) = \frac {dx}{dv}$? Or if not, which order are they in? $f(t,x,v) = \frac {dx}{dv}$ or for example $f(x,v,t) = \frac {dx}{dv}$?
In all the examples I have seen you are given a function, and where to put the numbers. I haven't come across anything non specific that teaches you what to do. If I know the order of the function, I guess I can follow the formula but if not I am stuck.
In other examples where you only have two variables, the formula changes and becomes:

Does it matter whether you calculate $k_0,$ or $l_0$ first and then continue that path $k_0$,$l_0$,$k_1$,$l_1$ or $l_0$,$k_0$, and so on? Because it seems like I can calculate either of them first without getting into problems.


The first point to realize is that you have a system of first-order differential equations in $t$ and a collection of dependent variables $\mathbf{y} = \{y_1,y_2, \ldots y_m\}$. In your case, $m=2$ and $\mathbf{y}$ is $\{x,v\}$. The system is then described by the dynamics $$ \frac{d \mathbf{y}}{dt} = \mathbf{f} (t, y_1, y_2, \ldots,y_m) $$ That is, what you and your books are calling $f$ and $g$ can be thought of as a function returning $m$ different values for the rate of change of the $m$ dependent ($y)$ variables. This is why your equations have $k_i$ and $l_i$ in them; $k_i$ relates to a (time) derivative of $x$ and $l_i$ relates to a derivative of $v$. I would prefer to call $f$ and $g$ as $f_1(t,x,v)$ and $f_2(t,x,v)$.
The Runge-Kutta algorithm starts by considering a step in time of $\frac12 h$ which translates to $\mathbf{y}_{n+\frac12} = \mathbf{y}_{n} + \mathbf{k}_0$ with $$ \mathbf{k}_0 =\left( \frac12 h v, \frac12 h \frac{\frac12\rho A v^2 - g}{m}\right) $$ You should recognize the first component as $k_0$ and the second as $l_0$.
Then you are again taking to a step in time of $\frac12 h$ (from the same starting time, only this time using the time derivatives obtained at $t = t_0 + \frac12 h$ by using the values of $\mathbf{k}_0$ you just computed. Because your system has on $x$ or $t$ dependence, this gives an equation which is very nearly the same as before: $$ \mathbf{k}_1 =\left( \frac12 h (v + \frac12 h), \frac12 h \frac{\frac12\rho A \left[v+\frac12 h \left( \frac12 h \frac{\frac12\rho A v^2 - g}{m}\right) \right]^2 - g}{m}\right)$$ The number in the square braces comes from the seond component of $\mathbf{k}_1$
$\mathbf{k}_2 $ is done similarly, using $\mathbf{k}_1$ to "step" instead of $\mathbf{k}_10$. Finally $\mathbf{k}_3$ takes a time step of the full $h$.
the last part of Runge-Kutta forms the unique compination of $\mathbf{k}_0$ through $\mathbf{k}_3$ that makes the solution exact in this interval of length $h$, up to errors of order $h^5$.