def Gain_22(RS, TS, URU, tdiffuse):
    """
    Two sphere gain in T sphere for light starting in T sphere.

    Similarly, when the light starts in the second sphere, the gain for light
    on the detector in the second sphere $G_{22}$ is found by switching
    all primed variables to unprimed.  Thus $G_{21}(r_s,t_s)$ is
    $$
    G_{22}(r_s,t_s) = {G'(r_s) over 1-a_s a_s' r_w r_w'
                                  (1-a_e)(1-a_e') G(r_s) G'(r_s)t_s²  }
    $$
    """
    G = RS.gain(URU)
    GP = TS.gain(URU)

    areas = RS.a_sample * TS.a_sample * (1 - RS.a_entrance) * (1 - TS.a_entrance)
    G22 = GP / (1 - areas * RS.r_wall * TS.r_wall * G * GP * tdiffuse**2)
    return G22