Mass/Volume = density.
Let the mass, volume and density of the first metal and second metal be m1,V1,ρ1,m2,V2,ρ2
Case 1: Volume of both metals are same and let it be equal to V
Hence, density = m1+m22V=Vρ1+Vρ22V=ρ1+ρ22=4kgm−3 -----------Eqn (1)
Case 2: Mass of both metals are same and let it be equal to M
Hence, density =2mV1+V2 = 2mmρ1+mρ2 = 2ρ1ρ2ρ1+ρ2= 3kgm−3 -----------Eqn (2)
Substitute (1) in (2),
3=2ρ1ρ2ρ1+ρ2 gives ρ1ρ2=12. Hence, ρ1 = 12ρ2
Solving, we get; ρ1=6or2.
Hence, ρ2=2or6