A∪X=B∪X for some set X
⇒A∩(A∪X)=A∩(B∪X)
⇒(A∩A)∪(A∩X)=A∩(B∪X)
⇒A=(A∩B)∪(A∩X)
⇒A=(A∩B)∪ϕ [∵A∩X=ϕ (given)]
⇒A=A∩B
⇒A⊂B .......(i)
Again, A∪X=B∪X
⇒B∩(A∪X)=B∩(B∪X)
⇒(B∩A)∪(B∩X)=(B∩B)∪(B∩X)
⇒(B∩A)∪(B∩X)=B
⇒(B∩A)∪ϕ=B [∵B∩X=ϕ (given)]
⇒B∩A=B
⇒B⊂A .........(ii)
From (i) and (ii) A=B.