According to question, two ideal atomic gases at temperatures T1 and T2 are mixed. Let the final temperature of this mixture be T. As per question there is no loss of energy, it means ΔU=0...(i) As, we know, ΔU=2f1n1RΔT+2f2n2RΔT....(ii) From Eqs. (i) and (ii), we get 2f1n1RΔT+2f2n2RΔT=0⇒f1n1RΔT+f2n2RΔT=0⇒f1n1R(T1−T)+f2n2R(T2−T)=0⇒f1n1(T1−T)+f2n2(T2−T)=0⇒f1n1T1−f1n1T+f2n2T2−f2n2T=0⇒f1n1T+f2n2T=f1n1T1+f2n2T2⇒T(f1n1+f2n2)=f1n1T1+f2n2T2T=f1n1+f2n2f1n1T1+f2n2T2