Density of liquid A = d1 and liquid B = d2, and assume the mass of liquid A or B = m (which is same for both liquids as per the question).
Volume of liquid A = m/d1
Volume of liquid B = m/d2
Total volume of the mixture = m/d1 + m/d2 (as liquid is incompressible).
Total mass = m + m = 2m.
Hence density of the mixture = 2m / (m/d1 + m/d2) = 2 / (1/d1 + 1/d2) (cancelling m).
Density of mixture = 2 * d1 * d2 / (d1 + d2)