why two displacements x1 & x2. It has to be same x.
now consider mass m1 upon whom F1 ia acting.
let's say the accelaratio of the system is a (= [F1-F2]/[m1+m2])
F1-kx=m1.a
Kx=F1-m1a=F1-m1(F1-F2)/(m1+m2)
x= 1/k[(m2.F1+m1.F2)/ (m1+m2)]
you can check the correctness of the answer by putting m1=m2 and/or F1=F2
when F1=F2,there will be no acceleration and extention x= F/k , simple. If m1=m2 , x= (F1+F2)/2k, again simple.