The midpoint of two points is given as
(x1 + x2)/2, (y1 + y2)/2
Given that the coordinates of the midpoint are (5, -1), let the coordinates of point B be x2 and y2
(2 + x2)/2 = 5
2 + x2 = 10
x2 = 10 - 2
x2 = 8
(-6 + y2)/2 = -1
-6 + y2 = -2
y2 = -2 + 6
y2 = 4
The coordinates of B are (8,4)