ΔT=250−40.0=210 K
Each rod expands independently by Δl=lαlΔT.
Brass rod:
Δlbrass=50×2.0×10−5×210=0.21 cm
Steel rod:
Δlsteel=50×1.2×10−5×210=0.126 cm
Combined rod:
Δl=0.21+0.126=0.336 cm≈0.34 cm
Thermal stress. Thermal stress arises when a body is prevented from expanding. Here the ends of the combined rod are free, so each rod can lengthen freely along its length and no thermal stress is developed along the rod; there is no thermal stress at the junction.
(Strictly, brass and steel also expand by different amounts across the diameter, so the joined faces try to grow to slightly different sizes. This can set up a localised stress right at the joint; the standard answer ignores it and considers only expansion along the length of the rod.)