The equation of the circle having (−2,1) and (4,−1) as the endpoints of its diameter is
x2+y2−2x−9=0
Equation of a circle when the end points (x1,y1) and (x2,y2) of its diameter are given, is given by,
(x−x1)(x−x2)+(y−y1)(y−y2)=0
So, when (−2,1) and (4,−1) are the end points of the diameter, equation of the circle would become:
(x+2)(x−4)+(y−1)(y+1)=0
⟹ x2+2x−4x−8+y2−y+y−1=0
⟹ x2+y2−2x−9=0