The equation of the circle having (−2,−1) and (2,1) as the endpoints of its diameter is
x2+y2=5
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−2)+(y+1)(y−1)=0
⟹ x2−4+y2−1=0
⟹ x2+y2−5=0
⟹ x2+y2=5