Let
1)I1 is the image formed by refraction from P1.
2)I2 is the image formed by reflection from P2.
3)I3 is the image formed by again refraction from P1.
Location of Image I1
1/p = -n/I1 ; so, I1 = -n.p from P1
-n.p + t from P2
Location of the image I2
-n.p + t behind the mirror or -n.p + t +t from P1
Location of the image I3
n/ (-n.p + t +t) = 1/x
x = (2t - np)/n
Thus (2t - np)/n is the final image position w.r.t P1.