As we know that gravity is given by
g = GMR2 and density ρ=massvolume
So, for planets A and B, the gravity can be written as
gA=G43πR3AρR2A;gB=G43πR3BρR2B
As RA=2RB ⇒gA=2gB
Escape velocity
Ves=√2gR
Escape velocity of planet B
(Ves)B=√2gBRB
Escape velocity of planet A
(Ves)A=√2gARA=2√2gBRB
(Ves)A(Ves)B=2