write the following formula where x is the subject (so separate x)
p (x - y) = q (z- x )
px - py = qz - qx
px + qx = qz + py
x (p+q) = qz + py
x = (qz+py) / (p+q)