Suppose that the $x$-coordinates of the points $A$ and $B$ satisfy $x^2+2 x-a^2=0$ and their $y$-coordinates…
Suppose that the $x$-coordinates of the points $A$ and $B$ satisfy $x^2+2 x-a^2=0$ and their $y$-coordinates satisfy $y^2+4 y-b^2=0$. Then, the equation of the circle with $A B$ as its diameter is
$x^2+y^2+2 x+4 y-a^2-b^2=0$
$x^2+y^2+2 x+4 y+a^2+b^2=0$
$x^2+y^2-2 x-4 y-a^2-b^2=0$
$x^2+y^2-2 x-4 y+a^2+b^2=0$
Solution
Let $x_1$ and $x_2$ are roots of equation
$x^2+2 x-a^2=0$ and $y_1$ and $y_2$ are roots of equation
$y^2+4 b-b^2=\left(x-x_1\right)\left(x-x_2\right)=0$
and $y^2+4 b-b^2 \rightarrow y_1, y_2$
$=\left(y-y_1\right)\left(y-y_2\right)$ (roots of equation)
Let $A\left(x_1, y_1\right)$ and $B\left(x_2, y_2\right)$.
Now, the equation of circle with diameter $A B$ is given by $\Rightarrow\left(x-x_1\right)\left(x-x_2\right)+\left(y-y_1\right)\left(y-y_2\right)=0$
$\begin{aligned} & \Rightarrow x^2+2 x-a^2+y^2+4 y-b^2=0 \\ & \Rightarrow x^2+y^2+2 x+4 y=a^2+b^2 \\ & \Rightarrow x^2+y^2+2 x+4 y-a^2-b^2=0\end{aligned}$