The condition for floating is
Weight = Upthrust
Vρ1g=V1ρ2g
where ρ1 = density of metal, ρ2 = density of mercury
∴ fraction of volume of metal submerged in mercury
V1V=ρ1ρ2=x (say)
Now, when the temperature is increased by ΔT,
ρ1=ρ11+γ1ΔT ...(1)
and ρ2=ρ21+γ2ΔT ...(2)
∴ new volume fraction,
x′=ρ1ρ2=(ρ11+γ1ΔT)×(1+γ2ΔTρ2)
=ρ1ρ2(1+γ2ΔT1+γ1ΔT)
⇒x′=x(1+γ2ΔT1+γ1ΔT)
∴x′x=1+γ2ΔT1+γ1ΔT