So here's my problem. I'm trying to run a simulation of a mass moving through two other fixed masses (with gravity). Let's call the moving mass mass 1, and the stationary masses mass 2 and mass 3. Mass 1 starts with an initial velocity $<v_x, v_y>$ and an initial position of $(x_1, y_1).$ Additionally, let the positions of mass 2 and mass 3 be $(x_2, y_2)$ and $(x_3, y_3)$. Now, when I run the simulation, I need to see how close I am to the actual curve, otherwise I don't know if I'm right or wrong. This is where my problem begins. The acceleration from a mass at a distance $r$ is $\dfrac{Gm}{r^2}$ (G is the gravitational constant). So, the acceleration from the fixed masses on mass 1 is $\dfrac{Gm_2}{r_2^2} + \dfrac{Gm_3}{r_3^2}$. The problem with finding the curve this etches out is, velocity is the integral of acceleration, distance is the integral of velocity, and acceleration is dependent upon position. Here's the full equation:
$$\vec{v} = \int_{0}^{t}{\vec{a}}\ dt = \int_{0}^{t}{\dfrac{Gm_2}{\Delta x_2^2+\Delta y_2^2}+\dfrac{Gm_2}{\Delta x_3^2+\Delta y_3^2}dt}$$
Now, let's take a look at the $\Delta x_2^2$.
$$\Delta x_2^2 = (x - x_1)^2 = (\int_{0}^{t}{v_{x_{1}}}\ dt-x_1)^2$$
$\vec{v_{x_2}} = \int_{0}^t{a_{x_2}}\ dt = \int_{0}^t a_{x_2} \cos{\theta_2}\ dt,$ for the $\theta$ between the x axis and the line going from the mass to $m_2$. I'm stuck on this one for a while now, any help?
P.S. I'm not sure how to add arrows above v and a, or make the integrals the right size. I'm pretty new to LaTex.
edit: fixed, thank you random stranger!
First, I should point out that your acceleration (following your intended notation) should be $\vec{a}_1 = -\dfrac{Gm_2}{r_2^2}\hat{r}_2 - \dfrac{Gm_3}{r_3^2}\hat{r}_3$ so we shall move forward with that notation. Note that this assumes $\Delta x_2 = x-x_2$ where $x$ is the $x$-coordinate of mass $1$.
This problem is best posed as a differential equation rather than as an iterated integral (essentially, solving an $n^\text{th}$ order differential equation is equivalent to integrating $n$ times). To derive an equation in Newtonian mechanics, we start with Newton's second law and make a particular statement of $ \vec{F} = m \vec{a} \text{ .}$ In cartesian coordinates, we can say that
$$ \begin{align} F_x &= ma_x = m\dfrac{\text{d}^2x}{\text{d}t^2}\\\\ F_y &= ma_y = m\dfrac{\text{d}^2y}{\text{d}t^2}\\\\ \end{align}$$
so as long as we separate the forces into their components correctly. The $x$-component of the forces should be
$$\begin{align} &F_x = \bigg(-\dfrac{Gm_2}{r_2^2}\hat{r}_2 - \dfrac{Gm_3}{r_3^2}\hat{r}_3\bigg)\cdot \hat{x}\\\\ \implies &F_x = \bigg(-\dfrac{Gm_2}{r_2^2}\cos{\theta}_2 -\dfrac{Gm_3}{r_3^2}\cos{\theta}_3\bigg)\\\\ \implies &F_x = \bigg(-\dfrac{Gm_2}{r_2^2}\frac{\Delta x_2}{r_2} - \dfrac{Gm_3}{r_3^2}\frac{\Delta x_3}{r_3}\bigg) \\\\ \implies &F_x = -\dfrac{Gm_2\Delta x_2}{ (\Delta x_2^2 + \Delta y_2^2)^{3/2}} - \dfrac{Gm_3\Delta x_3}{ (\Delta x_3^2 + \Delta y_3^2)^{3/2}}\end{align}$$
and by symmetry
$$ F_y = -\dfrac{Gm_2\Delta y_2}{ (\Delta x_2^2 + \Delta y_2^2)^{3/2}} - \dfrac{Gm_3\Delta y_3}{ (\Delta x_3^2 + \Delta y_3^2)^{3/2}} \text{ .}$$
Plugging into Newton's second law, we have
$$ \begin{align} m_1\dfrac{\text{d}^2x}{\text{d}t^2} &= -\dfrac{Gm_2(x-x_2)}{ ((x-x_2)^2 + (y-y_2)^2)^{3/2}} - \dfrac{Gm_3(x-x_3)}{ ((x-x_3)^2 + (y-y_3)^2)^{3/2}} \\\\ m_1\dfrac{\text{d}^2y}{\text{d}t^2} &= -\dfrac{Gm_2(y-y_2)}{ ((x-x_2)^2 + (y-y_2)^2)^{3/2}} - \dfrac{Gm_3(y-y_3)}{ ((x-x_3)^2 + (y-y_3)^2)^{3/2}} \text{ .} \\\\ \end{align} $$
This is the system you need to solve with your model if it relies solely on Cartesian coordinates.