We have a line AB with point P
A(5,1) which becomes (x1,y1)
P(3,7) which becomes (x,y)
B(x,y) which becomes (x2,y2)
Since it is a midpoint, we can use the midpoint formula directly.
x = (x1+x2)/2
3 = (5+x)/2
x=1
Thus our x coordinate is 1
y = (y1+y2)/2
7 = (1+y)/2
y=13
Thus our y coordinate is 13
Our answer is B(1,13)