We have a segment AC and B is in the middle. So AB + BC = AC because the segment is in pieces. Because B is a midpoint, AB = BC. We now have
AB + BC = AC sum of a segment is sum of its pieces
AB + AB = AC B is the midpoint, so AB = BC
2x + 2x = 3x + 20 putting in for AB (twice!) and AC
4x = 3x + 20 collect like terms
x = 20 subtract 3x on both sides.
So x=20