Comment
Q is the midpoint means that the two line segments are equal.
Equation
5x + 1 = 3x + 16
Solve
Subtract 1 from both sides.
5x = 3x + 16 - 1
5x = 3x + 15 Subtract 3x from both sides.
5x - 3x = 15
2x = 15 Divide by 2
x = 15/2
x = 7.5
Check
3(7.5) + 16 =? 5(7.5) + 1
22.5 + 16 =? 37.5 + 1
38.5 =? 38.5 and they do check.