Hey, I have this question from my Maths exam book "Determine an equation of the perpendicular bisector of the line segment $AD$, presenting it in the form y=mx+b"

The confusion I have is that there is 2 ways of solving this and I'm not sure which is better or correct?

Solution 1 (common way I found using google):- Find midpoint between A and D- Get the slope from A to D then get the inverse slope- Using the equation for a straight line (y=mx+b) fill in the midpoint and inverse slope to get "b" for the final answer.

Solution 2 (the book's method):- As the perpendicular bisector is equidistant from both points we equal the distance between them PA=PB (imagine there's a line above the letters). Using "P" as an arbitrary midpoint between them.- PA=PB -> Sqrt(dist of A to P)=Sqrt(dist of B to P)- PA=PB -> Sqrt$(Px - Ax)\^2 + (Py - Ay)\^2$ = Sqrt$(Px - Bx)\^2 + (Py - By)\^2$ -> (Px - Ax)\^2 + (Py - Ay)\^2 = (Px - Bx)\^2 + (Py - By)\^2 -> leads to a straight line equation once simplified and numbers are plugged in (y=mx+b)

Anyway, both solutions seem to work but I'm not sure which one is the "correct" way to do this? My intuition says that Solution 1 makes the most sense as you can get to each step from the other relatively intuitively after knowing what to do.

Also, when searching through Google I found a lot of information on Solution 1 but barely anything on the second. Maybe I'm searching the wrong things? Or is it called something else, because my book simply calls this (solution 2) the "Equation for the bisector of a line segment $AB$"

Hope this makes sense, any help is appreciated :)
Both work.  I would have done it the first way.