Hint: Use Coulomb's law.
Step 1: Find the location of the third charge.
Here, let us keep the charge 2q at a distance r from A.
Thus, the charge 2q will not experience any force when the force of repulsion on it due to q is balanced by the force of attraction on it due to -3q, at B, where AB = d.
Step 2: Find the net force on the charge and put it equal to zero.
Thus, force of attraction by -3q = Force of repulsion by q
⇒ 2q×q4πε0x2=2q×3q4πε0(x+d)2
⇒ (x+d)2=3x2
⇒ x2+d2+2xd=3x2
⇒ 2xd=2x2−d2
⇒2x2−2dx−d2=0
⇒x=d2±√3d2
Step 3: Choose the value with a positive sign.
(For negative sign, the position of the charge will be between q and -3q and hence is unadaptable.)
x=d2+√3d2=d2(1+√3) to the left of q.