Kepler's law problem 
Two planets A and B move around the Sun in elliptic orbits with time periods $T_A$ and
  $T_B$ respectively. If the eccentricity of the orbit of B is ε and its distance of closest
  approach to the Sun is R, then the maximum possible distance between the planets is?


Attempt at a solution
I think i am almost there but this is what i have so far.
Using the eccentricity and R, I found the expression for the semi major axis of B as $R_{SB}$=$\frac{R}{1-\epsilon}$ and using the relation for time periods, i have the expression for $R_{SA}$=$[\frac{T_A}{T_B}]^{2/3}$$\frac{R}{1-\epsilon}$
Now my doubt is whether to assume that two planets have sun at the same focus(say, on the right side ...picture concentric ellipses) in which case the maximum distance is when one of them is closest to the sun and the other is farthest OR if the two planets have sun at different focii (one to the left and other to the right, in this the orbits overlap partly; in either of the case, i cannot find a perfect expression for the maximum distance!


These are the two cases i am picturing, of course there might be many more oriented differently in the 2D. In the diagram on the left, max distance is when both are at their apogee. In the diagram on the left, its when one is at the apogee and the other is at the perigee. Is it possible to find an expression for distance which i can differentiate to find the max value?

Answer   is   $\frac{1+\epsilon}{1-\epsilon}$(1+($\frac{T_A}{T_B})^\frac{2}{3})$R
 A: The center of mass is at the focus of each orbit.  Assuming that the sun is far more massive than either of the planets, then the sun is at the focus for both orbits.  But note that, for a given elliptical orbit, the shape of the orbit doesn't change if you switch the center of mass from one focus to the other (it's symmetric).  Keep in mind that just because the Sun is at the focus for both, the orientation of the orbits is not necessarily aligned.
A: Make a sketch of the possible relative orientations of the 2 orbits. The planets will have maximum separation if the orbits are oriented with major axes aligned but set at $180^{\circ}$ - ie apogees on opposite sides of the focus.

In the diagram above, F is the common focus (the Sun), and the 2 planets can be anywhere on elliptical orbits A and B. While holding the larger orbit A fixed, vary the orientation of orbit B by rotating it about fixed point F. Planet B can then lie anywhere within circle C (shaded in pink), while A can lie anywhere on ellipse A. Without any need for a calculation you can see by eye ('by inspection') that the maximum separation is when the planets are at positions $a$ and $b$. 
The distances $aF$ and $Fb$ are the apogees of orbits A and B. The apogee of B is $(1+\epsilon)R_{SB}$ where $R_{SB}=\frac{R}{1-\epsilon}$ is the semi-major axis of B. Let the eccentricity of orbit A be $\delta$. Then the apogee of A is $(1+\delta)R_{SA}$ where $R_{SA}$ is the semi-major axis of A. $R_{SA}$ is related to $R_{SB}$ via Kepler's Third Law : $(\frac{T_A}{T_B})^2=(\frac{R_{SA}}{R_{SB}})^3$. The maximum possible distance ab is therefore
$(1+\epsilon)R_{SB}+(1+\delta)R_{SA}=(1+\frac{1+\delta}{1+\epsilon}(\frac{T_A}{T_B})^{\frac23})\frac{1+\epsilon}{1-\epsilon}R$. 
If we assume that $\delta=\epsilon$ then you get the expression in your answer key, viz. $(1+(\frac{T_A}{T_B})^{\frac23})\frac{1+\epsilon}{1-\epsilon}R$. However there is no requirement in the question to have $\delta=\epsilon$. The maximum possible value $\delta$ could take is 1, giving aF its maximum value of $2R_{SA}$. Then the maximum possible distance ab is $(1+\frac{2}{1+\epsilon}(\frac{T_A}{T_B})^{\frac23})\frac{1+\epsilon}{1-\epsilon}R$.
