Obviously for two balls just touching each other the restriction for the ball centres is
sqrt (sqr(x2-x1) + sqr(y2-y1)) =! 2r
where (x1,y1), (x2,y2) are the center coordinates of ball 1 and 2 and r is the radius (assuming same radius).
(x1,y1) are known, so we have one equation with two unknown variables. The equation is fulfilled for all (x2,y2) which are in distance 2r to (x1,y1), i.e. a circle around (x1,y1). You need a second restriction to reduce the solution to a single point. If you do not know what the restriction shall be, you won't be able to formulate a solution. Just "behind ball 1" is not sufficient.
You could say as second restriction that ball2 should be in the opposite direction of where ball1 moved. Say the movement of ball1 is (dx1,dy1), then the second restriction could be of sorts x2/y2 = -dx1/dy1. Probably not quite, and requires a bit more to avoid division by zero but such an additional restriction will allow a unique solution of the first one, and give you a target point for ball2 center, rather than a circle.
I guess however this scheme would look somehow unnatural. Personally I would do physical modelling, i.e. iterate the differential equations for two balls with an inertia, and a sort of magnetic force between them; the force will be attracting as long as distance > 2r, and repelling when distance <2r. The equations are trivial, a bit of care may be required to keep the system stable. This will look very natural, as if there is magnetism between the balls.