In order to calculate the distance from the second planet to Gliese 876, we can use the third law of Kepler:
[tex]\frac{D^3}{T^2}=k[/tex]Where D is the distance and T is the period of translation.
Since k is a constant, we can write the following equation:
[tex]\frac{D^3_1}{T^2_1}=\frac{D^3_2}{T^2_2}[/tex]Using D1 = 3.17*10^7 km, T1 = 65 days and T2 = 123 days, let's calculate D2:
[tex]\begin{gathered} \frac{(3.17\cdot10^7)^3}{65^2}=\frac{D^3_2}{123^2} \\ \frac{31.855\cdot10^{21}}{4225}=\frac{D^3_2}{15129} \\ D^3_2=\frac{31.855\cdot10^{21}\cdot15129}{4225} \\ D^3_2=114.067\cdot10^{21} \\ D_2=\text{4}.85\cdot10^7\text{ km} \end{gathered}[/tex]Therefore the wanted distance is 4.85 * 10^7 km.