Computing the gravitational force on a planet in a particular system I have a system of four planets moving in a 2D plane. I'm trying to write some code (C++) to find the positions of these planets at time t=3. 

I'm probably going to attempt this via a leapfrog integrator, though I'm open to suggestion. It seems I'm going to have to compute the acceleration of each planet, and to do this I'll use $F_i=m_ia_i$ and $F_i = \sum_{j\neq i} \frac{Gm_im_j}{r^2} $ where $i$ and $j$ denote particular planets. 
I'm a bit confused about how I compute that gravitational force though in this case; I'm pretty rusty on the physics. Some sources suggest $$F_i = \sum_{j\neq i} \frac{Gm_im_j}{((x_{0_i}-x_{0_j})^2+(x_{1_i}-x_{1_j})^2)^{3/2}}\sqrt{(x_{0_j}-x_{0_i})^2+(x_{1_j}-x_{1_i})^2} $$
But really I'm pretty confused. Another issue I'm having, is how I'm going to compute the acceleration in the $x$ direction and acceleration in the $y$ direction separately. 
Any guidance is much appreciated.
 A: The magnitude of the force between $i$ and $j$ is indeed
$$ F_{ij} = \frac{Gm_im_j}{\lvert\vec{r}_{ij}\rvert^2}. $$
The direction of this vector is directed along the line connecting the two points, the same as $\vec{r}_{ij}$ (my notation for the vector difference between the positions of $i$ and $j$). In principle you can compute the magnitude for each pair and decompose the result into an amount in each direction using trig functions.
In practice, the trig functions are unnecessary (you'd be taking trig functions of inverse trig functions anyway). The vector force on $i$ due to $j$ can be written
$$ \vec{F}_{ij} = \frac{Gm_im_j}{\lvert\vec{r}_{ij}\rvert^2} \frac{\vec{r}_{ij}}{\lvert\vec{r}_{ij}\rvert} = \frac{Gm_im_j}{\lvert\vec{r}_{ij}\rvert^3} \vec{r}_{ij}. $$ So the total force on $i$ has components
\begin{align}
F_i^1 & = \sum_{j\neq i} \frac{Gm_im_j}{(x_j-x_i)^2+(y_j-y_i)^2)^{3/2}} (x_j-x_i) \\
F_i^2 & = \sum_{j\neq i} \frac{Gm_im_j}{(x_j-x_i)^2+(y_j-y_i)^2)^{3/2}} (y_j-y_i).
\end{align}
You should of course divide through by $m_i$ to get the accelerations.
And yes, leapfrog is an excellent choice for this sort of thing, as I push on everyone every chance I get. Euler integration will send your planets flying off unphysically quite rapidly, and you have to be really careful when using non-symplectic integrators like Runge-Kutta -- these trade long-term stability for short-term accuracy.
