If M is the midpoint of PQ, then PM and MQ are equal.
As PM and MQ are given, equal them to each other to solve for x.
7x+8 = 5x+20
subtract 5x on both sides to get 2x+8 = 20
subtract 8 on both sides to get 2x = 12
divide by 2 on both sides to get x = 6
Use the value of x = 6 and plug it into the equations for PM and MQ to find their value.
PM = 7x + 8
= 7(6) + 8 = 42 + 8 = 50
(You can already tell MQ is also 50 as PM and MQ are equal, but we will still solve for MQ just for the fun of it)
MQ = 5x + 20
= 5(6) + 20 = 30 + 20 = 50
PM = 50
MQ = 50
PQ = PM + MQ = 50 + 50 = 100
Hope this helped!