Step 1: Use energy conservation for the mixing.
No energy leaves the system, so the total internal energy before mixing equals the total internal energy after mixing.
Step 2: Internal energy of an ideal gas.
For an ideal gas the internal energy is proportional to moles times temperature, $U = nC_V T$. The same $C_V$ appears for each part and will cancel out.
Step 3: Write the energy balance.
\[ n_1 C_V T_1 + n_2 C_V T_2 = (n_1+n_2)C_V T \]
Step 4: Cancel $C_V$ and solve for $T$.
\[ T = \frac{n_1 T_1 + n_2 T_2}{n_1 + n_2} \]
Step 5: Put in the numbers.
$n_1 = 3$, $T_1 = 300$ K, $n_2 = 5$, $T_2 = 500$ K. \[ T = \frac{3(300) + 5(500)}{3+5} \]
Step 6: Finish the arithmetic.
Numerator $= 900 + 2500 = 3400$, denominator $= 8$, so $T = \frac{3400}{8} = 425$ K.
\[ \boxed{T = 425\ \text{K}} \]