In this case, you can try to calculate the two forces individually, and then take the vector sum of the forces.
For the force between the point at (x,y) and (x.a1, y.a1), r.1=squareroot((x-x.a1)^2+(y-y.a1)^2). Using this, you can find F.1 from the formula F=GMm/r where you substitute r.1 for r and m.1 for M (assuming that the body has a mass m). Note that this is a scalar - the magnitude of F.1. To find F.1, you need to find the unit vector in the direction of r.1 : u.1.
Note that the direction vector of F.1, which is v.1 is equal to -u.1 (v.1=-u.1), because gravity is an attractive force. Thus, knowing both the magnitude (F.1) and the direction (v.1) of F.1, simply multiply them together and you will get F.1, the force with which the mass (m.1) at point (x.a1, y.a1) attracts the point at (x,y).
Now, repeat this process to find F.2, this time using r.2=squareroot((x-x.a2)^2+(y-y.a2)^2).
After this, add the two vectors F.1 and F.2 to find the net resultant force F acting on the mass at (x,y). Divide this by m (the mass of the red circle at (x,y)) to get the acceleration a. Now, you can integrate this with respect to time (dt) to get the velocity over time. Remember that the velocity v at t=0 is 0m/s. Use this to get rid of the constant of proportionality. You can also integrate this once more with respect to time (dt) to get position as a function of time. Remember that at t=0, x(0)=x and y(0)=y (where (x,y) is the initial position of the body). Remember to keep the i and j vectors through the integrations and separate them at the end to give separate functions for x(t) and y(t). I hope this helps and good luck!