First assume that a ≠ c and b≠ d. The gradient of PQ is (b −d)/(a −c), and so the gradient of the perpendicular line l is m = (c − a)/(b −d).
The line l goes through the midpoint ((a +c)/2, (b +d)/2) of PQ. Thus the equation of l is
y − (b +d)/2 = m (x − (a +c)/2)
(b −d)(2y − b − d) = (c − a)(2x − a − c)
2(b − d)y +(d2 − b2) = 2(c − a)x +(a2 −c2)
2(b −d)y +2(a −c)x = a2 + b2 −c2 −d2.
The final equation above is a sensible symmetric form for the equation of the perpendicular bisector of PQ. This equation is also correct in the case that a = c or b = d.
Alternatively, the question can be answered by finding the locus of all points X(x, y) equidistant from P(a,b) and Q(c,d).