How to set up an equation to solve a rate law computationally? I am confused on how to set up my equations to use in the solver. I have an equation
$$\ce{A + 2B -&gt; C}$$
As a given, it is first order in A and second order in B. What I need to do is to solve for the concentrations of all three of $\ce{A}$, $\ce{B}$ and $\ce{C}$ using an ordinary differential equation (computationally in Matlab). The rate constant is given as $\pu{8.5E-4}$. I am given all initial concentrations ($\pu{1.2 mol L-1}$ for both).  

To start off I have
$$r = k\ce{[A][B]2}$$
I have no idea where I should take this next, I feel completely lost here. 

The second part of this is to do the same thing, but instead of being irreversible, the reaction is given as reversible.
$$\ce{A + 2B &lt;=&gt; C}$$
The concentrations are all given as are the forward and backward rate constants. Its first order in $\ce{A}$, 2nd in $\ce{B}$, and first in $\ce{C}$. $\ce{[A]} = \pu{1.2 mol L-1}$, $\ce{[B]} = \pu{1.8 mol L-1}$, $\ce{[C]} = \pu{0.4 mol L-1}$, $k_\ce{for} = \pu{3.4E-2}$, $k_\ce{back} = \pu{1.2E-2}$.

Again my initial thoughts are
$$r = \frac{k_\ce{for}}{k_{back}} \times \frac{\ce{[A][B]^{2}}}{\ce{[C]}}$$
But again I just don't know where to go next.

I hope I made my question understandable, if not I'll try to clarify anything. Any and all help would be appreciated, I really need it!
It should be set up as a series of first order ordinary differential equations like so: $$\frac{d[A]}{dt}=-k_f[A][B]^2+k_r[C]$$$$\frac{d[B]}{dt}=-2k_f[A][B]^2+2k_r[C]$$
$$\frac{d[C]}{dt}=k_f[A][B]^2-k_r[C]$$
If we substitute $[C]=[C]_0+x$, $[A]=[A]_0-x$, and $[B]=[B]_0-2x$ into these equations, they all reduce to the single equation:$$\frac{dx}{dt}=k_f([A]_0-x)([B]_0-2x)^2-k_r([C]_0+x)$$