write the equation of the perpendicular bisector of AB

As the name suggests, the perpendicular bisector of a given segment is a line that is perpendicular to the given one and passes through its midpoint.
Remember that, if a line has slope m, a perpendicular line will have slope k, such that mk = -1.
Step 1: Slope of AB
We compute the slope with the usual formula
[tex] m = \dfrac{\Delta y}{\Delta x} = \dfrac{A_y-B_y}{A_x-B_x} = \dfrac{7-2}{1-4} = \dfrac{5}{-3} =-\dfrac{5}{3} [/tex]
Step 2: Perpendicular Slope
We're looking for a slope k such that
[tex] -\dfrac{5}{3}k=-1 \iff \dfrac{5}{3}k=1 \iff k = \dfrac{3}{5} [/tex]
Step 3: Midpoint of AB
The coordinates of the midpoint are the average of the coordinates of the endpoint. So, the midpoint M has coordinates
[tex] M_x = \dfrac{1+4}{2} = \dfrac{5}{2},\quad M_y = \dfrac{2+7}{2} = \dfrac{9}{2} [/tex]
So, the midpoint is (5/2,9/2)
Step 4: line equation
If you know the slope of a line, and a point belonging to it, the equation of the line is given by
[tex] y-y_0 = m(x-x_0) [/tex]
Plug your values:
[tex] y-\dfrac{9}{2} = \dfrac{3}{5}\left(x-\dfrac{5}{2}\right) [/tex]
Which you can rearrange as
[tex] y = \dfrac{3x}{5} + 3 [/tex]