In the circuit 10Ω and XΩ resistance are in series combination.
Thus, R=10+X
From the circuit diagram,
Current, i=RE =10+X5−2=10+X3
We know that VAB=E+ir
[∵ because current flows from positive terminal to negative terminal]
Here, VAB=4V 4=2+10+X3×X 2=10+X3X 2(10+X)=3X 20+2X=3X X=20Ω